example.mmademo
Class VideoPlayer

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Screen
          extended by javax.microedition.lcdui.Form
              extended by example.mmademo.VideoPlayer
All Implemented Interfaces:
java.lang.Runnable, javax.microedition.lcdui.CommandListener, javax.microedition.media.PlayerListener

public class VideoPlayer
extends javax.microedition.lcdui.Form
implements java.lang.Runnable, javax.microedition.lcdui.CommandListener, javax.microedition.media.PlayerListener

Play Video/Capture in a Form using MMAPI


Nested Class Summary
(package private)  class VideoPlayer.SnapshotThread
           
 
Field Summary
 
Fields inherited from interface javax.microedition.media.PlayerListener
BUFFERING_STARTED, BUFFERING_STOPPED, CLOSED, DEVICE_AVAILABLE, DEVICE_UNAVAILABLE, DURATION_UPDATED, END_OF_MEDIA, ERROR, RECORD_ERROR, RECORD_STARTED, RECORD_STOPPED, SIZE_CHANGED, STARTED, STOPPED, STOPPED_AT_TIME, VOLUME_CHANGED
 
Constructor Summary
VideoPlayer(javax.microedition.lcdui.Display parentDisplay)
           
 
Method Summary
 void close()
           
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable s)
           
(package private)  void initialize()
           
 void open(java.lang.String url)
           
 void pause()
           
 void pauseApp()
          Deallocate the player and the display thread.
 void playerUpdate(javax.microedition.media.Player plyr, java.lang.String evt, java.lang.Object evtData)
           
 void run()
           
 void start()
           
 void startApp()
          If the player was playing when the MIDlet was paused, then the player will be restarted here.
 void stopVideoPlayer()
           
 
Methods inherited from class javax.microedition.lcdui.Form
append, append, append, delete, deleteAll, get, getHeight, getWidth, insert, set, setItemStateListener, size
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getTicker, getTitle, isShown, removeCommand, setCommandListener, setTicker, setTitle, sizeChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VideoPlayer

public VideoPlayer(javax.microedition.lcdui.Display parentDisplay)
Method Detail

initialize

void initialize()

commandAction

public void commandAction(javax.microedition.lcdui.Command c,
                          javax.microedition.lcdui.Displayable s)
Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener

run

public void run()
Specified by:
run in interface java.lang.Runnable

open

public void open(java.lang.String url)

start

public void start()

close

public void close()

pause

public void pause()

playerUpdate

public void playerUpdate(javax.microedition.media.Player plyr,
                         java.lang.String evt,
                         java.lang.Object evtData)
Specified by:
playerUpdate in interface javax.microedition.media.PlayerListener

stopVideoPlayer

public void stopVideoPlayer()

pauseApp

public void pauseApp()
Deallocate the player and the display thread. Some VM's may stop players and threads on their own, but for consistent user experience, it's a good idea to explicitly stop and start resources such as player and threads.


startApp

public void startApp()
If the player was playing when the MIDlet was paused, then the player will be restarted here.