Applet - JavaScript     

VideoVista full support Javascript in these ways:   (find out more in demo section)

  • Javascript call to Applet method
  • Javascript cal to get Applet info
  • Applet call to Javascript function available in the page (CallBack)
  • Javascript call from Applet Events

In order to full support Javascript, you have to change applet code in this way:

<!-- VideoVista copy code from here -->
<object code="videovista.class" name="VideoVista" width="590" height="295" archive="videovista.jar" id="VideoVista" mayscript type="application/x-java-applet" >
<param name="mayscript" value="true" />
<param name="AutoPlay" value="true" />
<param name="VideoPath" value="video/nanny.vvf" /> 
<a href="http://www.vista.it/videovista/support/java_download" alt="Java Download" target="_blank"><br>Per poter vedere il video occorre Java;<br>seguire questo collegamento per installare Java.<br><br>The video available on this page requires Java;<br>follow this link to install it.<br></a>
</object>
<!-- VideoVista copy code to here -->

 

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:

<a href="javascript:{document.VideoVista.doSeek(10000);}">Seek1</a>

.

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:

document.VideoVista.getCurrentVideoPosition;

 

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:

<param name="CallbackEnabled" value="onStart(), onEnd(), etc. etc." />

JavaScript funtion that must be created in order to handle CallBack :

<script language="JavaScript" type="text/JavaScript">
function VideoVista_onStart() {
  // code on start ......
}
function VideoVista_onEnd() {
  // code on end ......
}
</script>

 

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:

  • Compatible with Microsoft JVM  1.1 as well
  • Not compatible with Microsoft JVM  1.1

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 :

<param name="EventNumber" value="2" />
<param name="Event1" value="3000,js1.1:Brightness(20),_self" />
<param name="Event2" value="3000,js1.1:Darkness(20),_self" />

You cannot call  Javascript directly; only following syntax is permitted: declaration:function(String)

  • js1.1:  (declare a compatible MSJVM1.1 function)
  • Brightness(20) (name of JavaScript function with string parameter)

Note: You can call only one function; 3rd parameter (_self) wont be used.

<script language="JavaScript" type="text/JavaScript">
function Brightness(string) {
  // code ......
}
function Darkness(string) {
  // code .....
}
</script>

 

 

 

 

 

 

Stampa il contenuto della pagina

Updated: 01-04-2010

 
Applet Player Online Help
 
Copyright 1997 - 2012 - Vista Tecnologie - Powered by preVISTA - Photos by: F.Busa, S.Pelloni, F.Taioli

Windows is a trademark of Microsoft. Flash is a trademark of Adobe. Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries. Java is a trademark of Sun Micorsystems, Inc.

Arredo Ufficio con Design Italiano è il ns. fornitore