Applet - JavaScript
VideoVista full support Javascript in these ways: (find out more in demo section)
In order to full support Javascript, you have to change applet code in this way:
Javascript call Applet's method
Following Java method can be used for e-learning project and for accessible pages as video can be managed using keyboard.
| Method | Description | Applet |
| doSeek(long seektime) | Play the video starting from time specify by input parameter; time is expressed in millisencods, so if want play a video starting from 1 minutes and 28 seconds you have to write: doSeek(88000) or vv_Seek(88000) . | |
| doPlay() | Play the video | |
| doPause() | Pause the video | |
| doStop() | Stop the video | |
| doAudioOff() | Disable audio | |
| doAudioOn() | Enable audio | |
| doMegaVisionOn() | MegaVision features On | |
| doMegaVisionOff() | MegaVision features Off | |
| doShowBlackAndWhiteVideo() | Play in Black % White | |
| doShowColorVideo() | Play in Color | |
| doBrightness(int val) | Increase video brightness (value) | 2.2.0 |
| doDarkness(int val) | Decrease video brightness (value) | 2.2.0 |
| doChangePlaylistVideo(int n) | Selects the (value) video present in playlist | 2.2.0 |
| doChangeVideoContent(String contentName) | Selects the (value) specify video conten (Modem, ADSL, etc.) | 2.2.0 |
| doChangeVideo(String video path) | Change current video | 2.2.2 |
| doStretchOn( ) | Do a Stretch On based on video and applet dimension | 2.3.1 |
| doStretchOff( ) | Do a Stretch Off based on video and applet dimension | 2.3.1 |
Sample:
.
Javascript call Applet's info
| Property | Description | Applet |
| long getCurrentVideoDuration() | Return video length milliseconds | 2.2.0 |
| long getPlaylistDuration() | Return total video length available in playlist milliseconds | 2.2.0 |
| long getCurrentVideoPosition() | Return current video position milliseconds | 2.2.0 |
| long getPlaylistPosition() | Return current video playing in playlist | 2.2.0 |
| String getVideoName() | Return video name (without extension) | 2.2.0 |
| String[ ] getAllPlaylistVideoName() | Return all videos name available in the playlist | 2.2.0 |
| int getPlaylistVideoNumber() | Return the number of video available in the playlist | 2.2.0 |
| String getCurrentContentName() | Return playing video content (Modem, ADSL, etc.) | 2.2.0 |
| String[ ] getAllContentName() | Return all video content name available in the video .vvf | 2.2.0 |
| long getCurrentContentKbs() | Return playing content bitrate | 2.2.0 |
| long[ ] getAllContentKbs() | Return all video content bitrate available in the video .vvf | 2.2.0 |
| long getKbsConnection() | Return client connection bitrate | 2.2.0 |
Esempio:
Chiamate dall'Applet a funzioni Javascript presenti nella pagina (CallBack)
| CallBack | Descrizione | Applet |
| onStart() | Call VideoVista_onStart() function when video starts | 2.2.0 |
| onPlay() | Call VideoVista_onPlay() function when video play | 2.2.0 |
| onPause() | Call VideoVista_onPause() function when video pause | 2.2.0 |
| onStop() | Call VideoVista_onStop() function when video stop | 2.2.0 |
| onSeek() | Call VideoVista_onSeek() function each time video is seeked | 2.2.0 |
| onEnd() | Call VideoVista_onStart() function when video ends | 2.2.0 |
| onChangeContent() | Call VideoVista_onChangeContent funtion each time video content changes (Modem, ADSL, etc.) | 2.2.0 |
| Note: You have to create VideoVista_onXX() function in the page, in order to handle the callback. |
Sample:
Parameter that must be present in the applet code:
JavaScript funtion that must be created in order to handle CallBack :
Javascript function called from Applet events
Javascript call from Applet events enable interaction by video on play and page elements. Javascript call from event can be of two type:
Based on your client web site audience, you can choose what kind of call you want; compatible or not. Compatible calls don't have the same flexibility the non compatible has.
Non MSJVM 1.1 compatible call sample :
<param name="EventNumber" value="2" />
<param name="Event1" value="8000,javascript:{document.VideoVista.doBrightness(20);},_self" />
<param name="Event2" value="15000,javascript:{document.VideoVista.doDarkness(20);},_self" />
Increase video brightness (value 20) between 8-15 seconds without declare any other function.
Note: inside javascritp:{} declaration, you can insert whatever piece of javascript code you want.
MSJVM 1.1 compatible call sample :
You cannot call Javascript directly; only following syntax is permitted: declaration:function(String)
Note: You can call only one function; 3rd parameter (_self) wont be used.
Updated: 01-04-2010