Playing Video


<strong>MMAPI(Mobile Media API) provides a framework for playing media content on J2ME devices.There are protocols defined for real-time streaming of Internet radio content, streaming other RTP (Real-time Transport Protocol) content, capturing audio, and taking pictures.</strong>

<strong>The method below plays a video file the on mobile device:</strong>
<strong>public void run()</strong>
<strong>{</strong>
<strong> try</strong>
<strong> {</strong>
<strong> String url = “http://server/video-mpeg.mpg”;</strong>
<strong> Player p = Manager.createPlayer(url);</strong>
<strong> p.realize();</strong>

<strong>//Get the video controller</strong>
<strong> VideoControl video = (VideoControl) p.getControl(”VideoControl”);</strong>

<strong>//Get a GUI to display the video</strong>
<strong> Item videoItem = (Item)video.initDisplayMode(</strong>
<strong> VideoControl.USE_GUI_PRIMITIVE, null);</strong>

<strong>//Append the GUI to a form</strong>
<strong> videoForm.append(videoItem);</strong>

<strong>//Start the video</strong>
<strong> p.start();</strong>
<strong> }</strong>
<strong> catch(Exception e)</strong>
<strong> {}</strong>
<strong>}</strong>

<strong>If you want to play the video from an rtsp server, you only need to change url with “rtsp://server/video.mpg”. This will only work on devices which support real time input streams.</strong>

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Zoemalang's community

ujung malang adalah Sebuah desa yang hilang terganti dengan ujung harapan

YoYo Games Blog Feed

Ujung malang adalah Sebuah desa yang hilang terganti dengan ujung harapan

Dealer Termurah

Menjual Segala Jenis Motor Baru Di Indonesia Cash Maupun Kredit

%d blogger menyukai ini: