Skip to main content

ImageRotatorApi – JW Player

The Image Rotator contains a small javascript API. It can be enabled by setting the flashvar enablejs=true. When set, the rotator can be controlled by calling the function sendEvent() on the rotator. Additionally, the rotator will automatically send updates to a global getUpdate() javascript function.

enablejs

Here's an example of an embed code that enables the rotator javascript API:


src="rotator.swf"
width="300"
height="300"
flashvars="file=playlist.xml&enablejs=true"
name="rotator"
id="rotator"
/>

    src = "rotator.swf"
    width = "300"
    height = "300"
    FlashVars = "file = playlist.xml & enablejs = true"
    nama = "rotator"
    id = "rotator"
/>

src="rotator.swf"
width="300"
height="300"
flashvars="file=playlist.xml&enablejs=true"
name="rotator"
id="rotator"
/>
The enablejs=true flashvar turns on the API. The name and id flashvar give the rotator a unique ID in the HTML DOM, so its sendEvent function can be called.

sendEvent

The sendEvent function can be directly called upon the rotator. If thename and id of the rotator is set to rotator (as in the above embed code), events can be sent like this:

function next() {
// make the imagerotator jump to the next image.
document.getElementById('rotator').sendEvent('next');
};

    / / Make the leap to the next image imagerotator.
    document.getElementById ('rotator') sendEvent ('next').;
};

// make the imagerotator jump to the next image.
document.getElementById('rotator').sendEvent('next');
};

// make the imagerotator jump to the next image.
document.getElementById('rotator').sendEvent('next');
};
The following events are available:

  • getlink (index): redirect the browser to the link of photo number index.

  • next: jump to the next image.

  • playitem ( index ): jump to image number index .

  • playpause: pause or resume the rotator (acts like a toggle).

  • prev: jump to the previous image.

  • volume (percent): set the volume of the audiotrack to percent (provided you use an audiotrack).

getUpdate

When the enablejs=true flashvar is set, the rotator automatically sends status updates to javascript. In order to receive those, you need to define a javascript function called getUpdate on your page:

function getUpdate(type,parameter1,parameter2) { 
alert('Received a '+type+' update from the rotator');
alert('Parameters: '+parameter1+' - '+ parameter2);
};

    alert ('Accept' + type + 'update of the rotator');
    alert ('Parameter:' paramater1 + + '-' + parameter2);
};

alert('Received a '+type+' update from the rotator');
alert('Parameters: '+parameter1+' - '+ parameter2);
};
The rotator sends the following types of updates:

  • item (index): the rotator switches to image number index.

  • load (percent): the current image is loaded for percent percent.

  • size (width,height): the current image has the dimensions width by height.

  • state (index): the current playback state is state, whereby the state can be the following:
    • 0: the rotatot is paused.

    • 1: the rotator is buffering for playback.

    • 2: the rotator is playing.

    • 3: the rotator has completed playback.

    • 4: the rotator is idle; has not started yet.


  • time (elapsed,remaining): the rotator has played the current image for elapsed seconds and has remaining seconds to go yet.

  • volume (percent): the current volume of the rotator is percent.

ImageRotatorApi – JW Player

Comments

Popular posts from this blog

Kivandanu, Could one of our premium services help you?

http://srudut.com 2011/2/22 John Dalt < John@galtstock.com > You are receiving this message, because you have subscribed to the newslettera1 newsletter on Monday, January 17th, 2011. To ensure that you continue to receive emails from us, add John@galtstock.com to your address book promptly.         Galtstock       Research for Online Investors HOME       ARCHIVE     NEWS      RESOURCES       DIVERSIONS Monday Morning The market set a new 52-week high Friday...where does it end?  Today reports out of Libya don't sound promising.  Protesters have burned the General Assembly building.  BP is evacuating their personnel. Guddafi is reported to be heading to Venezuela. There were also reports yesterday of protests in China.  The police quickly arrested any suspicious actors.  Suffice it to say, this is not a market you can buy and forget.   There are plenty of moving pieces to keep track of...problems and opportuni

Download Qari/Reciters and Translations, Al-Quran ReadPen Data

  Al-Quran ReadPen Data Download Qori/Reciters and Translations   Qori/Reciter Files Sr. Qori/Reciter Name File Size Updates 01. Al Sheikh Ali Abdul Rahman Al Huzaifi 222 MB 17 Mar 2012 02. Al Sheikh Abdul Basit 'Abd us-Samad 387 MB 19 Mar 2012 03. Al Sheikh Mishary bin Rashid Al-Afasy 228 MB 13 Mar 2012 04. Al Sheikh Ahmad Ali Mohammad ‘al Soulayman Al Ajamy 212 MB 17 Mar 2012 05. Al Sheikh Salaah bin Muhammad Al Budair 164 MB 17 Mar 2012 06. Al Sheikh Mohammed Al-Alim Al-Dokhail 417 MB 07 Oct 2011 07. Al Sheikh Sa’ad Al-Ghamdi 201 MB 13 Mar 2012 08. Al Sheikh Mahmoud Khal