Member Area - Sitemap - Cart
 
Products / Zentu Platform / Zentu Encoder /

Javascript API


 

Javascript API

Javascript API for Zentu/VX30 Applet

JS CONSTRUCTOR SUMMARY

var videoApplet = document.applets[?ztmPlayer?]

METHOD SUMMARY

void

play(String metaURL, String backgroundColor, String videoTitle)

This function allows you to load a video into the applet.

void

stop_playback()

Used to stop the applet - rewinds back to beginning of video

void

pause_playback()

Used to pause the applet

void

start_playback()

Used to start the video either from stopped or paused state

void

toggle_playback()

Used to start or pause playback depending on current state

void

mute()

Mutes audio

void

unmute()

Resumes audio

void

toggle_mute

Mutes or Resumes volume depending on current state

void

set_volume(double percent)

Sets audio level to percent specified by fraction of one. 0 – silence, 1 – maximum level.

double

get_volume()

Returns audio level value previously set by set_volume

void

show_fscreen

Method moves video frame to a separate resizable window.

void

hide_fscreen

Method moves video frame to its original place on a web page and closes zoom window.

void

toggle_fscreen

Method toggles video frame location between web page and separate window.

void

set_callback_on_playback_start(String jsCode)

Method used to initiate JavaScript command on playback start.

void

set_callback_on_playback_stop(String jsCode)

Method used to initiate JavaScript command on playback stop.

void

set_callback_on_playback_pause(String jsCode)

Method used to initiate JavaScript command on pause.

int

METHOD DETAIL

public void play(String metaURL, String backgroundColor, String videoTitle)

Method launches playback of movie specified by URL of its meta-file.

example

onClick="document.applets.ztmPlayer.play('India_0.meta.zentu', '777777', 'India')"

Parameters

metaURL - either the name of the meta file or the individual zentu file that you wish to play.

backgroundColor - the hexadecimal value of the color you wish the applets background to be set to.

videoTitle - the title of the pop-up window when the video is enlarged.

See also: stop_playback() , pause_playback() , start_playback() , toggle_playback()

public void stop_playback()

This function will stop the video and reset the timeline to zero.

See also: play(String metaURL, String backgroundColor, String videoTitle) , pause_playback() , start_playback() , toggle_playback()

public void pause_playback()

This function will stop the video and the timeline will stay in its current position.

See also: play(String metaURL, String backgroundColor, String videoTitle) , stop_playback() , start_playback() , toggle_playback()

public void start_playback()

This function will start the video from it?s current position on the timeline.

See also: play(String metaURL, String backgroundColor, String videoTitle) , stop_playback() , pause_playback() , toggle_playback()

public void toggle_playback()

Method toggles playback depending on current state.

See also: play(String metaURL, String backgroundColor, String videoTitle) , stop_playback() , pause_playback() , start_playback()

public void mute()

Method mutes audio.

See also: unmute() , toggle_mute()

public void unmute()

Method resumes audio.

See also: mute() , toggle_mute()

public void toggle_mute()

Method mutes or resumes audio depending on current state.

See also: mute() , unmute()

Method sets audio level to percent specified by fraction of one. 0 – silence, 1 – maximum level.
See also: get_volume

Returns audio level value previously set by set_volume.
See also: set_volume

public void show_fscreen()

Method used to have video open in its own resizable window.

See also: hide_fscreen() , toggle_fscreen()

public void hide_fscreen()

Method destroys pop-up video window and resumes video in original web page.

See also: show_fscreen() , toggle_fscreen()

public void toggle_fscreen()

Method toggle between show_fscreen() and hide_fscreen() depending on current state.

See also: show_fscreen() , hide_fscreen()

public void set_callback_on_playback_start(String jsCode)

Method used to initiate a JavaScript command on playback start.

Example

document.applets.ztmPlayer.set_callback_on_playback_start('window.alert("start");');

Parameters

jsCode - the Javascript code that should be execute on playback start.

See also: set_callback_on_playback_stop , set_callback_on_playback_pause

public void set_callback_on_playback_stop(String jsCode)

Method used to initiate a JavaScript command on playback stop.

Example

document.applets.ztmPlayer.set_callback_on_playback_stop('window.alert("stopped");');

Parameters

jsCode - the Javascript code that should be execute on playback start.

See also: set_callback_on_playback_start , set_callback_on_playback_pause

public void set_callback_on_playback_pause(String jsCode)

Method used to initiate a JavaScript command on playback stop.

Example

document.applets.ztmPlayer.set_callback_on_playback_pause('window.alert("paused");');

Parameters

jsCode - the Javascript code that should be execute on playback start.

See also: set_callback_on_playback_start , set_callback_on_playback_stop

public int get_status()

Function returns integer value that represent internal state of player.

Bit 0 ? playback is paused (0 ? false, 1 ? true);

Bit 1 ? playback is stopped (0 ? false, 1 ? true);

Bit 2 ? audio is muted (0 ? false, 1 ? true);

Bit 3 ? video is shown in a separate resizable window (0 ? false, 1 ? true);

Example

Function returns number 5 (0101b). Therefore playback is paused, audio is not muted, video is running directly in a web page.

© 2005 Maui X-Stream Inc. All rights reserved. US Patent(s): #6,938,047 B2