<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.xiph.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shans</id>
	<title>XiphWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.xiph.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shans"/>
	<link rel="alternate" type="text/html" href="https://wiki.xiph.org/Special:Contributions/Shans"/>
	<updated>2026-05-15T03:52:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlay&amp;diff=7915</id>
		<title>OggPlay</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlay&amp;diff=7915"/>
		<updated>2007-11-30T01:34:51Z</updated>

		<summary type="html">&lt;p&gt;Shans: /* MacOS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
OggPlay is a library designed to allow drop-in playback of Xiph.Org media in an application.  OggPlay handles demuxing and decoding, generates timestamps for raw data, maintains synchronisation across multiple streams, and provides a lock-free buffer implementation for easy multithreading.&lt;br /&gt;
&lt;br /&gt;
An example use of OggPlay library is OggPlay Mozilla Firefox plugin demonstrating how the library can be used to provide Ogg playback in a web browser. OggPlay plugin is implemented through Mozilla NPAPI. The target platforms for the plugin are: Linux/UNIX, Win200x/XP/Vista and MACOSX. The libary as much as the plugin are open source under triple&lt;br /&gt;
MPL/GPL/LGPL license. For more details about Mozilla licesing refer to [http://www.mozilla.org/MPL/ Mozilla Code Licensing].&lt;br /&gt;
&lt;br /&gt;
OggPlay is a &#039;&#039;&#039;work in progress&#039;&#039;&#039;: the first release should be availably by mid-2007.  &lt;br /&gt;
&lt;br /&gt;
OggPlay is located on [http://www.annodex.net Annodex], which has been moved in March over to the Xiph.Org servers.  SVN access to the source code is available through http://svn.annodex.net/liboggplay/trunk.&lt;br /&gt;
&lt;br /&gt;
== Developer&#039;s Guide ==&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
For instructions how to compile and install Linux version of OggPlay Mozilla plugin refer to [http://wiki.xiph.org/index.php/OggPlay/Linux Linux Developement and Intallation Guide].&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
The Win32 version of the plugin has been developed and tested on Win200x/XP platforms.&lt;br /&gt;
&lt;br /&gt;
For detailed instructions how to setup Mozilla plugin development environment and start hacking on Win32 version of OggPlay Mozilla Firefox plugin go to [http://wiki.xiph.org/index.php/OggPlay/Win32 Win32 Development and Installation Guide.]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The same link provides links to the plugin binaries and instructions how to install and test Oggplay Mozilla plugin.&lt;br /&gt;
&lt;br /&gt;
=== MacOS ===&lt;br /&gt;
&lt;br /&gt;
Check out http://svn.annodex.net/liboggplay/trunk/plugin/mac/mac-annodex-dev-install.sh, put it in a working directory somewhere, run the script, and follow the directions.&lt;br /&gt;
&lt;br /&gt;
== Plugin Javascript API ==&lt;br /&gt;
&lt;br /&gt;
View the [[OggPlayJavascriptAPI | draft OggPlay plugin Javascript API]]&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6705</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6705"/>
		<updated>2007-05-16T01:20:14Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This is a &#039;&#039;&#039;draft API&#039;&#039;&#039; for the OggPlay Firefox plugin.&lt;br /&gt;
&lt;br /&gt;
We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
Note that the amount of available information for an internet-cast Ogg stream depends upon the type of server providing that stream.  In particular, an apache server with mod-annodex installed provides the following information that is not available for live-streamed or raw file-streamed movies:&lt;br /&gt;
* length of the movie&lt;br /&gt;
* CMML annotations for the entire movie in advance&lt;br /&gt;
&lt;br /&gt;
Furthermore, mod-annodex provides remote seeking functionality across the entire movie.  Hence, Oggplay allows arbitrary seeking on mod-annodex supported movies.  On the other hand, raw streams and live streams are only seekable within the region that has already been buffered by the player.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEndPlayCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEndPlayCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== setVolume ===&lt;br /&gt;
&lt;br /&gt;
 setVolume(float volume)&lt;br /&gt;
&lt;br /&gt;
Use this function to set the playback volume.  A value of 0.0 is equivalent to muting; a value of 1.0 is maximum volume.&lt;br /&gt;
&lt;br /&gt;
=== getVolume ===&lt;br /&gt;
&lt;br /&gt;
 float volume &amp;lt;- getVolume()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the current playback volume.&lt;br /&gt;
&lt;br /&gt;
=== getWindowWidth ===&lt;br /&gt;
&lt;br /&gt;
 int width &amp;lt;- getWindowWidth()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the width of the window in pixels (The width is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getWindowHeight ===&lt;br /&gt;
&lt;br /&gt;
 int height &amp;lt;- getWindowHeight()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the height of the window in pixels (The height is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getBufferedTime ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getBufferedTime()&lt;br /&gt;
&lt;br /&gt;
Use this function to determine how many milliseconds of the current movie are buffered for display.  Note that this is the amount downloaded past the currently playing point, not just the amount decoded past the currently playing point.&lt;br /&gt;
&lt;br /&gt;
=== getMovieLength ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getMovieLength()&lt;br /&gt;
&lt;br /&gt;
Use this function to determine how long in milliseconds a movie is.  Note that this value will not be available for some movies, depending on the server.  If no value is available, then this function will return a length of -1.&lt;br /&gt;
&lt;br /&gt;
=== getVersionString ===&lt;br /&gt;
&lt;br /&gt;
To retrieve a version string:&lt;br /&gt;
&lt;br /&gt;
 string version &amp;lt;- getVersionString()&lt;br /&gt;
&lt;br /&gt;
This string will be of the format:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;liboggplay (a.b) Annodex Media Plugin (API x.y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Where a.b is the liboggplay version, and x.y is the API version.  Once accepted, this API will be version 1.0.  Minor changes of the API can add functions but not modify existing functions.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
* &amp;lt;tt&amp;gt;getMovieLength&amp;lt;/tt&amp;gt; will retrieve the movie length for the current movie only.  Use &amp;lt;tt&amp;gt;getMovieLengthAt&amp;lt;/tt&amp;gt; to retrieve he movie length for movies in the playlist that are not currently playing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB&amp;lt;/tt&amp;gt; will be called once&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
=== getMovieLengthAt ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getMovieLengthAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the length of the movie at the specified position in the playlist.  The function will return -1 if the movie length can not be determined.&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6704</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6704"/>
		<updated>2007-05-16T01:14:42Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This is a &#039;&#039;&#039;draft API&#039;&#039;&#039; for the OggPlay Firefox plugin.&lt;br /&gt;
&lt;br /&gt;
We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
Note that the amount of available information for an internet-cast Ogg stream depends upon the type of server providing that stream.  In particular, an apache server with mod-annodex installed provides the following information that is not available for live-streamed or raw file-streamed movies:&lt;br /&gt;
* length of the movie&lt;br /&gt;
* CMML annotations for the entire movie in advance&lt;br /&gt;
&lt;br /&gt;
Furthermore, mod-annodex provides remote seeking functionality across the entire movie.  Hence, Oggplay allows arbitrary seeking on mod-annodex supported movies.  On the other hand, raw streams and live streams are only seekable within the region that has already been buffered by the player.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEODCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEODCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== setVolume ===&lt;br /&gt;
&lt;br /&gt;
 setVolume(float volume)&lt;br /&gt;
&lt;br /&gt;
Use this function to set the playback volume.  A value of 0.0 is equivalent to muting; a value of 1.0 is maximum volume.&lt;br /&gt;
&lt;br /&gt;
=== getVolume ===&lt;br /&gt;
&lt;br /&gt;
 float volume &amp;lt;- getVolume()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the current playback volume.&lt;br /&gt;
&lt;br /&gt;
=== getWindowWidth ===&lt;br /&gt;
&lt;br /&gt;
 int width &amp;lt;- getWindowWidth()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the width of the window in pixels (The width is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getWindowHeight ===&lt;br /&gt;
&lt;br /&gt;
 int height &amp;lt;- getWindowHeight()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the height of the window in pixels (The height is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getBufferedTime ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getBufferedTime()&lt;br /&gt;
&lt;br /&gt;
Use this function to determine how many milliseconds of the current movie are buffered for display.  Note that this is the amount downloaded past the currently playing point, not just the amount decoded past the currently playing point.&lt;br /&gt;
&lt;br /&gt;
=== getMovieLength ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getMovieLength()&lt;br /&gt;
&lt;br /&gt;
Use this function to determine how long in milliseconds a movie is.  Note that this value will not be available for some movies, depending on the server.  If no value is available, then this function will return a length of -1.&lt;br /&gt;
&lt;br /&gt;
=== getVersionString ===&lt;br /&gt;
&lt;br /&gt;
To retrieve a version string:&lt;br /&gt;
&lt;br /&gt;
 string version &amp;lt;- getVersionString()&lt;br /&gt;
&lt;br /&gt;
This string will be of the format:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;liboggplay (a.b) Annodex Media Plugin (API x.y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Where a.b is the liboggplay version, and x.y is the API version.  Once accepted, this API will be version 1.0.  Minor changes of the API can add functions but not modify existing functions.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
* &amp;lt;tt&amp;gt;getMovieLength&amp;lt;/tt&amp;gt; will retrieve the movie length for the current movie only.  Use &amp;lt;tt&amp;gt;getMovieLengthAt&amp;lt;/tt&amp;gt; to retrieve he movie length for movies in the playlist that are not currently playing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB&amp;lt;/tt&amp;gt; will be called once&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
=== getMovieLengthAt ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getMovieLengthAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the length of the movie at the specified position in the playlist.  The function will return -1 if the movie length can not be determined.&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6703</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6703"/>
		<updated>2007-05-16T01:00:29Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This is a &#039;&#039;&#039;draft API&#039;&#039;&#039; for the OggPlay Firefox plugin.&lt;br /&gt;
&lt;br /&gt;
We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEODCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEODCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== setVolume ===&lt;br /&gt;
&lt;br /&gt;
 setVolume(float volume)&lt;br /&gt;
&lt;br /&gt;
Use this function to set the playback volume.  A value of 0.0 is equivalent to muting; a value of 1.0 is maximum volume.&lt;br /&gt;
&lt;br /&gt;
=== getVolume ===&lt;br /&gt;
&lt;br /&gt;
 float volume &amp;lt;- getVolume()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the current playback volume.&lt;br /&gt;
&lt;br /&gt;
=== getWindowWidth ===&lt;br /&gt;
&lt;br /&gt;
 int width &amp;lt;- getWindowWidth()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the width of the window in pixels (The width is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getWindowHeight ===&lt;br /&gt;
&lt;br /&gt;
 int height &amp;lt;- getWindowHeight()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the height of the window in pixels (The height is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getBufferedTime ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getBufferedTime()&lt;br /&gt;
&lt;br /&gt;
Use this function to determine how many milliseconds of the current movie are buffered for display.  Note that this is the amount downloaded past the currently playing point, not just the amount decoded past the currently playing point.&lt;br /&gt;
&lt;br /&gt;
=== getMovieLength ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getMovieLength()&lt;br /&gt;
&lt;br /&gt;
Use this function to determine how long in milliseconds a movie is.  Note that this value will not be available for some movies, depending on the server.  If no value is available, then this function will return a length of -1.&lt;br /&gt;
&lt;br /&gt;
=== getVersionString ===&lt;br /&gt;
&lt;br /&gt;
To retrieve a version string:&lt;br /&gt;
&lt;br /&gt;
 string version &amp;lt;- getVersionString()&lt;br /&gt;
&lt;br /&gt;
This string will be of the format:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;liboggplay (a.b) Annodex Media Plugin (API x.y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Where a.b is the liboggplay version, and x.y is the API version.  Once accepted, this API will be version 1.0.  Minor changes of the API can add functions but not modify existing functions.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
* &amp;lt;tt&amp;gt;getMovieLength&amp;lt;/tt&amp;gt; will retrieve the movie length for the current movie only.  Use &amp;lt;tt&amp;gt;getMovieLengthAt&amp;lt;/tt&amp;gt; to retrieve he movie length for movies in the playlist that are not currently playing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB&amp;lt;/tt&amp;gt; will be called once&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
=== getMovieLengthAt ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getMovieLengthAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the length of the movie at the specified position in the playlist.  The function will return -1 if the movie length can not be determined.&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
== mdale&#039;s email ==&lt;br /&gt;
&lt;br /&gt;
* getVideoLength calls&lt;br /&gt;
&lt;br /&gt;
* live vs onDemand streams&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6702</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6702"/>
		<updated>2007-05-16T00:56:25Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This is a &#039;&#039;&#039;draft API&#039;&#039;&#039; for the OggPlay Firefox plugin.&lt;br /&gt;
&lt;br /&gt;
We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEODCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEODCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== setVolume ===&lt;br /&gt;
&lt;br /&gt;
 setVolume(float volume)&lt;br /&gt;
&lt;br /&gt;
Use this function to set the playback volume.  A value of 0.0 is equivalent to muting; a value of 1.0 is maximum volume.&lt;br /&gt;
&lt;br /&gt;
=== getVolume ===&lt;br /&gt;
&lt;br /&gt;
 float volume &amp;lt;- getVolume()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the current playback volume.&lt;br /&gt;
&lt;br /&gt;
=== getWindowWidth ===&lt;br /&gt;
&lt;br /&gt;
 int width &amp;lt;- getWindowWidth()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the width of the window in pixels (The width is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getWindowHeight ===&lt;br /&gt;
&lt;br /&gt;
 int height &amp;lt;- getWindowHeight()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the height of the window in pixels (The height is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getBufferedTime&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getBufferedTime()&lt;br /&gt;
&lt;br /&gt;
Use this function to determine how many milliseconds of the current movie are buffered for display.  Note that this is the amount downloaded past the currently playing point, not just the amount decoded past the currently playing point.&lt;br /&gt;
&lt;br /&gt;
=== getVersionString ===&lt;br /&gt;
&lt;br /&gt;
To retrieve a version string:&lt;br /&gt;
&lt;br /&gt;
 string version &amp;lt;- getVersionString()&lt;br /&gt;
&lt;br /&gt;
This string will be of the format:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;liboggplay (a.b) Annodex Media Plugin (API x.y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Where a.b is the liboggplay version, and x.y is the API version.  Once accepted, this API will be version 1.0.  Minor changes of the API can add functions but not modify existing functions.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB&amp;lt;/tt&amp;gt; will be called once&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
== mdale&#039;s email ==&lt;br /&gt;
&lt;br /&gt;
* calls to get the buffered state or how much of a given clip is buffered&lt;br /&gt;
&lt;br /&gt;
* getVideoLength calls&lt;br /&gt;
&lt;br /&gt;
* live vs onDemand streams&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6692</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6692"/>
		<updated>2007-05-15T06:05:06Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This is a &#039;&#039;&#039;draft API&#039;&#039;&#039; for the OggPlay Firefox plugin.&lt;br /&gt;
&lt;br /&gt;
We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEODCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEODCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== setVolume ===&lt;br /&gt;
&lt;br /&gt;
 setVolume(float volume)&lt;br /&gt;
&lt;br /&gt;
Use this function to set the playback volume.  A value of 0.0 is equivalent to muting; a value of 1.0 is maximum volume.&lt;br /&gt;
&lt;br /&gt;
=== getVolume ===&lt;br /&gt;
&lt;br /&gt;
 float volume &amp;lt;- getVolume()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the current playback volume.&lt;br /&gt;
&lt;br /&gt;
=== getWindowWidth ===&lt;br /&gt;
&lt;br /&gt;
 int width &amp;lt;- getWindowWidth()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the width of the window in pixels (The width is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getWindowHeight ===&lt;br /&gt;
&lt;br /&gt;
 int height &amp;lt;- getWindowHeight()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the height of the window in pixels (The height is determined by the Firefox render model)&lt;br /&gt;
&lt;br /&gt;
=== getVersionString ===&lt;br /&gt;
&lt;br /&gt;
To retrieve a version string:&lt;br /&gt;
&lt;br /&gt;
 string version &amp;lt;- getVersionString()&lt;br /&gt;
&lt;br /&gt;
This string will be of the format:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;liboggplay (a.b) Annodex Media Plugin (API x.y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Where a.b is the liboggplay version, and x.y is the API version.  Once accepted, this API will be version 1.0.  Minor changes of the API can add functions but not modify existing functions.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB&amp;lt;/tt&amp;gt; will be called once&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
== mdale&#039;s email ==&lt;br /&gt;
&lt;br /&gt;
* calls to get the buffered state or how much of a given clip is buffered&lt;br /&gt;
&lt;br /&gt;
* getVideoLength calls&lt;br /&gt;
&lt;br /&gt;
* live vs onDemand streams&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6691</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6691"/>
		<updated>2007-05-15T06:02:24Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This is a &#039;&#039;&#039;draft API&#039;&#039;&#039; for the OggPlay Firefox plugin.&lt;br /&gt;
&lt;br /&gt;
We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEODCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEODCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== setVolume ===&lt;br /&gt;
&lt;br /&gt;
 setVolume(float volume)&lt;br /&gt;
&lt;br /&gt;
Use this function to set the playback volume.  A value of 0.0 is equivalent to muting; a value of 1.0 is maximum volume.&lt;br /&gt;
&lt;br /&gt;
=== getVolume ===&lt;br /&gt;
&lt;br /&gt;
 float &amp;lt;- getVolume()&lt;br /&gt;
&lt;br /&gt;
Use this function to retrieve the current playback volume.&lt;br /&gt;
&lt;br /&gt;
=== getVersionString ===&lt;br /&gt;
&lt;br /&gt;
To retrieve a version string:&lt;br /&gt;
&lt;br /&gt;
 string version &amp;lt;- getVersionString()&lt;br /&gt;
&lt;br /&gt;
This string will be of the format:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;liboggplay (a.b) Annodex Media Plugin (API x.y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Where a.b is the liboggplay version, and x.y is the API version.  Once accepted, this API will be version 1.0.  Minor changes of the API can add functions but not modify existing functions.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB&amp;lt;/tt&amp;gt; will be called once&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
* volume control&lt;br /&gt;
&lt;br /&gt;
* query for width and height&lt;br /&gt;
&lt;br /&gt;
== mdale&#039;s email ==&lt;br /&gt;
&lt;br /&gt;
* calls to get the buffered state or how much of a given clip is buffered&lt;br /&gt;
&lt;br /&gt;
* getVideoLength calls&lt;br /&gt;
&lt;br /&gt;
* live vs onDemand streams&lt;br /&gt;
&lt;br /&gt;
* disabling/enabling audio&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6690</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6690"/>
		<updated>2007-05-15T06:00:33Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This is a &#039;&#039;&#039;draft API&#039;&#039;&#039; for the OggPlay Firefox plugin.&lt;br /&gt;
&lt;br /&gt;
We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEODCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEODCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== getVersionString ===&lt;br /&gt;
&lt;br /&gt;
To retrieve a version string:&lt;br /&gt;
&lt;br /&gt;
 string version &amp;lt;- getVersionString()&lt;br /&gt;
&lt;br /&gt;
This string will be of the format:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;liboggplay (a.b) Annodex Media Plugin (API x.y)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Where a.b is the liboggplay version, and x.y is the API version.  Once accepted, this API will be version 1.0.  Minor changes of the API can add functions but not modify existing functions.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB&amp;lt;/tt&amp;gt; will be called once&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
* volume control&lt;br /&gt;
&lt;br /&gt;
* query for width and height&lt;br /&gt;
&lt;br /&gt;
== mdale&#039;s email ==&lt;br /&gt;
&lt;br /&gt;
* calls to get the buffered state or how much of a given clip is buffered&lt;br /&gt;
&lt;br /&gt;
* getVideoLength calls&lt;br /&gt;
&lt;br /&gt;
* live vs onDemand streams&lt;br /&gt;
&lt;br /&gt;
* disabling/enabling audio&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6689</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6689"/>
		<updated>2007-05-15T04:58:15Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEODCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEODCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB&amp;lt;/tt&amp;gt; will be called once&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
* volume control&lt;br /&gt;
&lt;br /&gt;
* query for width and height&lt;br /&gt;
&lt;br /&gt;
== mdale&#039;s email ==&lt;br /&gt;
&lt;br /&gt;
* calls to get the buffered state or how much of a given clip is buffered&lt;br /&gt;
&lt;br /&gt;
* getVideoLength calls&lt;br /&gt;
&lt;br /&gt;
* live vs onDemand streams&lt;br /&gt;
&lt;br /&gt;
* disabling/enabling audio&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6688</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6688"/>
		<updated>2007-05-15T04:45:16Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEODCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEODCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB&amp;lt;/tt&amp;gt; will be called once&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* kfish: a callback to specify what to do when reaching the end of playback (also for change of items)&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
* volume control&lt;br /&gt;
&lt;br /&gt;
* query for width and height&lt;br /&gt;
&lt;br /&gt;
== mdale&#039;s email ==&lt;br /&gt;
&lt;br /&gt;
* calls to get the buffered state or how much of a given clip is buffered&lt;br /&gt;
&lt;br /&gt;
* getVideoLength calls&lt;br /&gt;
&lt;br /&gt;
* live vs onDemand streams&lt;br /&gt;
&lt;br /&gt;
* disabling/enabling audio&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6687</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6687"/>
		<updated>2007-05-15T04:44:20Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
=== registerEODCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method when the movie finishes:&lt;br /&gt;
&lt;br /&gt;
 registerEODCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
* &amp;lt;tt&amp;gt;registerEODCallback&amp;lt;/tt&amp;gt; will call back at the end of the playlist (i.e. at the end of the last movie) only.  Use &amp;lt;tt&amp;gt;registerPlaylistCallback&amp;lt;/tt&amp;gt; to recieve notifications per movie.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== registerPlaylistCallback ===&lt;br /&gt;
&lt;br /&gt;
 registerPlaylistCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use this function to register a javascript function that will get called by the plugin at the end of each movie in the playlist - i.e. when the playlist changes tracks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the last track will also trigger a call.  In the following circumstance&lt;br /&gt;
&lt;br /&gt;
 // there are 3 movies in the playlist&lt;br /&gt;
 registerPlaylistCallback(callbackA)&lt;br /&gt;
 registerEODCallback(callbackB)&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;tt&amp;gt;callbackA&amp;lt;/tt&amp;gt; will be called 3 times, and &amp;lt;tt&amp;gt;callbackB will be called once&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* kfish: a callback to specify what to do when reaching the end of playback (also for change of items)&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
* volume control&lt;br /&gt;
&lt;br /&gt;
* query for width and height&lt;br /&gt;
&lt;br /&gt;
== mdale&#039;s email ==&lt;br /&gt;
&lt;br /&gt;
* calls to get the buffered state or how much of a given clip is buffered&lt;br /&gt;
&lt;br /&gt;
* getVideoLength calls&lt;br /&gt;
&lt;br /&gt;
* live vs onDemand streams&lt;br /&gt;
&lt;br /&gt;
* disabling/enabling audio&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6686</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6686"/>
		<updated>2007-05-15T03:09:03Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* ctford: it might make sense to divide the methods up and give them to separate object. the most recent version of the VLC api for example has a playlist, an audio, a video, an input and a log object&lt;br /&gt;
&lt;br /&gt;
* kfish: a callback to specify what to do when reaching the end of playback (also for change of items)&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
* volume control&lt;br /&gt;
&lt;br /&gt;
* query for width and height&lt;br /&gt;
&lt;br /&gt;
== mdale&#039;s email ==&lt;br /&gt;
&lt;br /&gt;
* calls to get the buffered state or how much of a given clip is buffered&lt;br /&gt;
&lt;br /&gt;
* getVideoLength calls&lt;br /&gt;
&lt;br /&gt;
* live vs onDemand streams&lt;br /&gt;
&lt;br /&gt;
* disabling/enabling audio&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6663</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6663"/>
		<updated>2007-05-13T13:43:15Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* ctford: it might make sense to divide the methods up and give them to separate object. the most recent version of the VLC api for example has a playlist, an audio, a video, an input and a log object&lt;br /&gt;
&lt;br /&gt;
* kfish: a callback to specify what to do when reaching the end of playback (also for change of items)&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
* volume control&lt;br /&gt;
&lt;br /&gt;
* query for width and height&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6662</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6662"/>
		<updated>2007-05-13T13:33:40Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* ctford: it might make sense to divide the methods up and give them to separate object. the most recent version of the VLC api for example has a playlist, an audio, a video, an input and a log object&lt;br /&gt;
&lt;br /&gt;
* kfish: a callback to specify what to do when reaching the end of playback (also for change of items)&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;br /&gt;
&lt;br /&gt;
* volume control&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6661</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6661"/>
		<updated>2007-05-13T13:15:40Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* ctford: it might make sense to divide the methods up and give them to separate object. the most recent version of the VLC api for example has a playlist, an audio, a video, an input and a log object&lt;br /&gt;
&lt;br /&gt;
* kfish: a callback to specify what to do when reaching the end of playback (also for change of items)&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup] (e.g. getDuration)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6660</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6660"/>
		<updated>2007-05-13T13:15:21Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* ctford: it might make sense to divide the methods up and give them to separate object. the most recent version of the VLC api for example has a playlist, an audio, a video, an input and a log object&lt;br /&gt;
&lt;br /&gt;
* kfish: a callback to specify what to do when reaching the end of playback (also for change of items)&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;br /&gt;
&lt;br /&gt;
* another point of comparison: [http://mplayerplug-in.cvs.sourceforge.net/mplayerplug-in/mplayerplug-in/DOCS/tech/javascript.txt?view=markup]&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6659</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6659"/>
		<updated>2007-05-13T13:09:48Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* ctford: it might make sense to divide the methods up and give them to separate object. the most recent version of the VLC api for example has a playlist, an audio, a video, an input and a log object&lt;br /&gt;
&lt;br /&gt;
* kfish: a callback to specify what to do when reaching the end of playback (also for change of items)&lt;br /&gt;
&lt;br /&gt;
* ctford: a versionInfo() method like VLC&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6658</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6658"/>
		<updated>2007-05-13T13:08:02Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;br /&gt;
&lt;br /&gt;
= Suggested modifications =&lt;br /&gt;
&lt;br /&gt;
* ctford: it might make sense to divide the methods up and give them to separate object. the most recent version of the VLC api for example has a playlist, an audio, a video, an input and a log object&lt;br /&gt;
&lt;br /&gt;
* kfish: a callback to specify what to do when reaching the end of playback (also for change of items)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6642</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6642"/>
		<updated>2007-05-11T05:34:34Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The plugin does not actually recognise separate &amp;quot;single movie&amp;quot; and &amp;quot;playlist&amp;quot; modes - instead, single movies are actually just playlists with length 1.  The interface has been arranged so that the functions above &amp;quot;just work&amp;quot; for what looks like a single movie mode, but are also useful when multiple movies are inserted into the playlist.&lt;br /&gt;
&lt;br /&gt;
The following additional functions are also available for manipulation of the playlist.  These functions are also available when there is only one movie in the playlist, but don&#039;t provide much in the way of useful features.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6641</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6641"/>
		<updated>2007-05-11T05:30:28Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
In addition, the following additional functions are available for manipulation of the playlist.  These functions are also available when operating in individual movie mode, and reduce to the case of a playlist with only one entry - e.g. &amp;lt;tt&amp;gt;getPlaylistLength&amp;lt;/tt&amp;gt; will return 1.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6640</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6640"/>
		<updated>2007-05-11T05:30:05Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
In addition, the following additional functions are available for manipulation of the playlist.  These functions are also available when operating in individual movie mode, and reduce to the case of a playlist with only one entry - e.g. &amp;lt;tt&amp;gt;getPlaylistLength&amp;lt;/tt&amp;gt; will return 1.&lt;br /&gt;
&lt;br /&gt;
=== freezePlaylistProgression ===&lt;br /&gt;
&lt;br /&gt;
 freezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlayPosition ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlaylistProgression()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlaylistProgression.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6639</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6639"/>
		<updated>2007-05-11T05:24:45Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie - i.e. the movie at the current playlist position&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
In addition, the following additional functions are available for manipulation of the playlist.  These functions are also available when operating in individual movie mode, and reduce to the case of a playlist with only one entry - e.g. &amp;lt;tt&amp;gt;getPlaylistLength&amp;lt;/tt&amp;gt; will return 1.&lt;br /&gt;
&lt;br /&gt;
=== freezePlayPosition ===&lt;br /&gt;
&lt;br /&gt;
 freezePlayPosition()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlayPosition ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlayPosition()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlayPosition.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPlaylistPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPlaylistPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6638</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6638"/>
		<updated>2007-05-11T04:56:23Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, false will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie.  In situations where the size of movies not yet encountered can not be determined (e.g. if mod-annodex is not installed on the server), then false will be returned if &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; requests a position past the furthest encountered position, and the furthest encountered position will be set.&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
In addition, the following additional functions are available for manipulation of the playlist.  These functions are also available when operating in individual movie mode, and reduce to the case of a playlist with only one entry - e.g. &amp;lt;tt&amp;gt;getPlaylistLength&amp;lt;/tt&amp;gt; will return 1.&lt;br /&gt;
&lt;br /&gt;
=== freezePlayPosition ===&lt;br /&gt;
&lt;br /&gt;
 freezePlayPosition()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlayPosition ===&lt;br /&gt;
&lt;br /&gt;
 unfreezePlayPosition()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlayPosition.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;br /&gt;
&lt;br /&gt;
=== appendMovie ===&lt;br /&gt;
&lt;br /&gt;
To append a movie to the end of the playlist:&lt;br /&gt;
&lt;br /&gt;
 appendMovie(string url)&lt;br /&gt;
&lt;br /&gt;
=== insertMovieBefore ===&lt;br /&gt;
&lt;br /&gt;
To insert a movie before a specified position in the playlist:&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- insertMovieBefore(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return false if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPositionWithinMovie()&lt;br /&gt;
&lt;br /&gt;
This function retrieves the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; to retrieve the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== setPlayPositionWithinMovie ===&lt;br /&gt;
&lt;br /&gt;
 boolean success &amp;lt;- setPlayPositionWithinMovie(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
This function sets the play position in milliseconds relative to the beginning of the current movie.&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; to set the play position relative to the beginning of the playlist.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotationsAt ===&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotationsAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function retrieves the CMML annotations from the movie at the specified position in the playlist.  The function will return an empty string in the following cases:&lt;br /&gt;
&lt;br /&gt;
* the movie at this position has no annotation&lt;br /&gt;
* the movie at this position is being served from a server that does not support out-of-band annotation retrieval&lt;br /&gt;
* the position is not a valid position (i.e. is outside the bounds of the playlist)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6637</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6637"/>
		<updated>2007-05-11T04:44:29Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean error &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, an error flag will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* &amp;lt;tt&amp;gt;restart&amp;lt;/tt&amp;gt; will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; retrieves the currently playing movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* &amp;lt;tt&amp;gt;getPlayPosition&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;setPlayPosition&amp;lt;/tt&amp;gt; operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie&lt;br /&gt;
* &amp;lt;tt&amp;gt;retrieveAnnotations&amp;lt;/tt&amp;gt; will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
In addition, the following additional functions are available for manipulation of the playlist.  These functions are also available when operating in individual movie mode, and reduce to the case of a playlist with only one entry - e.g. &amp;lt;tt&amp;gt;getPlaylistLength&amp;lt;/tt&amp;gt; will return 1.&lt;br /&gt;
&lt;br /&gt;
=== freezePlayPosition ===&lt;br /&gt;
&lt;br /&gt;
 freezePlayPosition()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlayPosition ==&lt;br /&gt;
&lt;br /&gt;
 unfreezePlayPosition()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlayPosition.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getCurrentPosition ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the position in the playlist of the current movie:&lt;br /&gt;
&lt;br /&gt;
 int position &amp;lt;- getCurrentPosition()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
This function will return null if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;getCurrentMovie&amp;lt;/tt&amp;gt; can be used to retrieve the movie at the current position.&lt;br /&gt;
&lt;br /&gt;
=== setMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To set the url of the movie at the specified position (0 is the first position):&lt;br /&gt;
&lt;br /&gt;
 boolean error &amp;lt;- setMovieAt(int position, string url)&lt;br /&gt;
&lt;br /&gt;
This function will return true if the position points to a slot outside the bounds of the playlist.&lt;br /&gt;
&lt;br /&gt;
Remember that &amp;lt;tt&amp;gt;setCurrentMovie&amp;lt;/tt&amp;gt; can be used to change the currently playing movie.&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6636</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6636"/>
		<updated>2007-05-11T04:35:55Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean error &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, an error flag will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;getCurrentState&amp;lt;/tt&amp;gt; will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* restart will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* getCurrentMovie retrieves the currently playing movie&lt;br /&gt;
* setCurrentMovie sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* getPlayPosition and setPlayPosition operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie&lt;br /&gt;
* retrieveAnnotations will retrieve the annotations for the current movie only&lt;br /&gt;
&lt;br /&gt;
In addition, the following additional functions are available for manipulation of the playlist&lt;br /&gt;
&lt;br /&gt;
=== freezePlayPosition ===&lt;br /&gt;
&lt;br /&gt;
 freezePlayPosition()&lt;br /&gt;
&lt;br /&gt;
This function does not stop the current movie from playing, but does prevent the plugin from progressing to the next movie in the playlist.  Use this and unfreezePlayPosition for &amp;quot;atomic&amp;quot; operations on the playlist.&lt;br /&gt;
&lt;br /&gt;
=== unfreezePlayPosition ==&lt;br /&gt;
&lt;br /&gt;
 unfreezePlayPosition()&lt;br /&gt;
&lt;br /&gt;
See documentation for freezePlayPosition.&lt;br /&gt;
&lt;br /&gt;
=== getPlaylistLength ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the length of the playlist:&lt;br /&gt;
&lt;br /&gt;
 int length &amp;lt;- getPlaylistLength()&lt;br /&gt;
&lt;br /&gt;
=== getMovieAt ===&lt;br /&gt;
&lt;br /&gt;
To get the url of the movie at the specified position:&lt;br /&gt;
&lt;br /&gt;
 string url &amp;lt;- getMovieAt(int position)&lt;br /&gt;
&lt;br /&gt;
Remember that&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6635</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6635"/>
		<updated>2007-05-11T03:59:07Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean error &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, an error flag will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;br /&gt;
&lt;br /&gt;
* getCurrentState will not return FINISHED until the last movie in the playlist has completed playback&lt;br /&gt;
* restart will start from the beginning of the playlist, not the beginning of the current movie&lt;br /&gt;
* getCurrentMovie retrieves the currently playing movie&lt;br /&gt;
* setCurrentMovie sets the currently playing movie (and playback will begin from the beginning of the newly set movie, not the beginning of the playlist)&lt;br /&gt;
* getPlayPosition and setPlayPosition operate on the playlist as a whole - i.e. if a playlist consists of a 5 second, a 7 second and a 4 second movie, then setPlayPosition(6000) will start playing from 1 second into the 2nd movie&lt;br /&gt;
* retrieveAnnotations will retrieve the annotations for the current movie only&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6634</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6634"/>
		<updated>2007-05-11T03:51:02Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean error &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, an error flag will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAnnotations ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAnnotations()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;br /&gt;
&lt;br /&gt;
== Playlists ==&lt;br /&gt;
&lt;br /&gt;
If you wish to use playlists instead of individual movies, then the above function calls still exist, with the following caveats:&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6633</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6633"/>
		<updated>2007-05-11T03:49:14Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean error &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, an error flag will be returned and the play position will be updated as far forward as possible.&lt;br /&gt;
&lt;br /&gt;
=== registerCMMLCallback ===&lt;br /&gt;
&lt;br /&gt;
To have the plugin call a javascript method as each CMML annotation is encountered (i.e. as movie playback reaches the point where the annotation needs to be inserted):&lt;br /&gt;
&lt;br /&gt;
 registerCMMLCallback(function callback)&lt;br /&gt;
&lt;br /&gt;
Use null if you want to deregister the callback without setting a new one.&lt;br /&gt;
&lt;br /&gt;
=== retrieveAllCMML ===&lt;br /&gt;
&lt;br /&gt;
To retrieve all of the CMML annotations for a movie:&lt;br /&gt;
&lt;br /&gt;
 string CMML &amp;lt;- retrieveAllCMML()&lt;br /&gt;
&lt;br /&gt;
Note that this won&#039;t return all annotations from some servers, e.g. if mod-annodex is not installed.  In this case, you will still be able to retrieve CMML as each annotation is encountered using registerCMMLCallback.&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6632</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6632"/>
		<updated>2007-05-11T02:07:21Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== getPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To get the current play position (in milliseconds) from the movie:&lt;br /&gt;
&lt;br /&gt;
 int milliseconds &amp;lt;- getPlayPosition()&lt;br /&gt;
&lt;br /&gt;
=== setPlayPosition ===&lt;br /&gt;
&lt;br /&gt;
To set the current play position (in milliseconds):&lt;br /&gt;
&lt;br /&gt;
 boolean error &amp;lt;- setPlayPosition(int milliseconds)&lt;br /&gt;
&lt;br /&gt;
Note that if you set a position past the end of the movie then the result will be a play position at the end of the movie, and the player in FINISHED mode.&lt;br /&gt;
&lt;br /&gt;
Note also that certain servers (e.g. plain Ogg files, no mod-annodex installed, etc.) will prevent seeking from being able to occur past the buffered portion of the file; in this case, an error flag will be returned and the play position will be updated as far forward as possible.&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6631</id>
		<title>OggPlayJavascriptAPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlayJavascriptAPI&amp;diff=6631"/>
		<updated>2007-05-11T01:59:37Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We want the OggPlay plugin to support both a simple individual movie mode, and a more fully-featured playlist mode.  All of the functions supported in individual movie mode are still useful in playlist mode; however additional functions also become useful.&lt;br /&gt;
&lt;br /&gt;
== Individual movies ==&lt;br /&gt;
&lt;br /&gt;
=== OggPlayState ===&lt;br /&gt;
&lt;br /&gt;
 enum OggPlayState { PAUSED = 0; PLAYING = 1; FINISHED = 2 };&lt;br /&gt;
&lt;br /&gt;
These are fairly self-evident: the plugin begins in PAUSED or PLAYING state depending on the settings provided through the params tags, and changes to FINISHED state when the movie finishes playback.&lt;br /&gt;
&lt;br /&gt;
=== getCurrentState ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the state:&lt;br /&gt;
&lt;br /&gt;
 int &amp;lt;- getCurrentState()&lt;br /&gt;
&lt;br /&gt;
=== pause ===&lt;br /&gt;
&lt;br /&gt;
 pause()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PLAYING or FINISHED states to PAUSED.&lt;br /&gt;
&lt;br /&gt;
=== play ===&lt;br /&gt;
&lt;br /&gt;
 play()&lt;br /&gt;
&lt;br /&gt;
This function will convert the PAUSED state to PLAYING or FINISHED depending upon the current position within the movie.&lt;br /&gt;
&lt;br /&gt;
=== restart ===&lt;br /&gt;
&lt;br /&gt;
 restart()&lt;br /&gt;
&lt;br /&gt;
This function will convert any state to PLAYING, and start the movie again from the beginning&lt;br /&gt;
&lt;br /&gt;
=== getCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To retrieve the currently playing (or just played, or about to play) movie:&lt;br /&gt;
&lt;br /&gt;
 string URL &amp;lt;- getCurrentMovie()&lt;br /&gt;
&lt;br /&gt;
=== setCurrentMovie ===&lt;br /&gt;
&lt;br /&gt;
To set a new movie:&lt;br /&gt;
&lt;br /&gt;
 setCurrentMovie(string URL)&lt;br /&gt;
&lt;br /&gt;
This will automatically begin playing at the beginning if the state is PLAYING or FINISHED, but will remain paused ready to play at the beginning if the state is PAUSED.&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlay&amp;diff=6630</id>
		<title>OggPlay</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlay&amp;diff=6630"/>
		<updated>2007-05-11T01:46:46Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OggPlay is a library designed to allow drop-in playback of Xiph.Org media in an application.  OggPlay handles demuxing and decoding, generates timestamps for raw data, maintains synchronisation across multiple streams, and provides a lock-free buffer implementation for easy multithreading.&lt;br /&gt;
&lt;br /&gt;
OggPlay is a &#039;&#039;&#039;work in progress&#039;&#039;&#039;: the first release should be availably by mid-2007.&lt;br /&gt;
&lt;br /&gt;
OggPlay is currently hosted by [http://www.annodex.net Annodex], although there are plans to move hosting over to the Xiph.Org servers.  SVN access is available through http://svn.annodex.net/liboggplay/trunk.&lt;br /&gt;
&lt;br /&gt;
View the [[OggPlayJavascriptAPI | draft OggPlay plugin Javascript API]]&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=Summer_of_Code_2008&amp;diff=6487</id>
		<title>Summer of Code 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=Summer_of_Code_2008&amp;diff=6487"/>
		<updated>2007-03-20T08:00:56Z</updated>

		<summary type="html">&lt;p&gt;Shans: /* Ogg and Annodex integration into open source web Content Management Systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Current Ideas ==&lt;br /&gt;
&lt;br /&gt;
This is  our ideas page for [http://code.google.com/soc/ Google Summer of Code] projects with [http://xiph.org Xiph.org] and [http://annodex.net/ Annodex]. The two projects are participating jointly this year under Xiph&#039;s name.&lt;br /&gt;
&lt;br /&gt;
We need a primary and backup mentor volunteer for any project that is to become an official proposal, but submit something and we&#039;ll see who we can round up. :)&lt;br /&gt;
&lt;br /&gt;
note: Google Summer of Code 2007, mentoring organizations to apply between March 5 and March 12, students March 14 - March 24&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Students&#039;&#039;&#039; please use the template at [[Summer of Code Applications]] when applying for a GSoC position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentors&#039;&#039;&#039; for details of our mentor application and plan, please see [[Summer of Code 2007]].&lt;br /&gt;
&lt;br /&gt;
Students should also check out projects related to the [http://wiki.elphel.com/index.php?title=SoC Elphel Open Source cameras].&lt;br /&gt;
&lt;br /&gt;
=== Optimize Theora encoding/decoding speed, SSE/SSE2 ===&lt;br /&gt;
Work on MMX, SSE/SSE2 implementations of the crucial encoding and&lt;br /&gt;
decoding  elements in [http://svn.xiph.org/trunk/theora/ libtheora] and/or [http://svn.xiph.org/trunk/theora-exp theora-exp].&lt;br /&gt;
This could include porting the vp3 mmx and altivec code to the libtheora decoder, and writing sse improvements on the&lt;br /&gt;
mmx work that has already been done. The results must still build cleanly on other archs and do &lt;br /&gt;
run-time capability detection.&lt;br /&gt;
&lt;br /&gt;
You could start improving this [http://lists.xiph.org/pipermail/theora-dev/2005-August/002838.html MMX loop filter patch for theora-exp] that was never completed nor merged in current theora-exp (see all list thread).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Ralph Giles, Timothy Terriberry, backup: Jan Gerber, Mike Smith&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Encode support in theora-exp ===&lt;br /&gt;
Implement a rate-distortion optimized encoding mode for [http://svn.xiph.org/trunk/theora-exp/ theora-exp],&lt;br /&gt;
including R-D optimzed mode decision and quantization (e.g., constant&lt;br /&gt;
lambda). Then, use the above routines to implement a medium-latency ABR&lt;br /&gt;
encoding mode (e.g., varying lambda), with a default target buffer size&lt;br /&gt;
of approximately 2 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Timothy &amp;quot;Derf&amp;quot; Terriberry, backup: Mike Smith, Ralph Giles&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Development assistant for the &amp;quot;Ghost&amp;quot; audio codec ===&lt;br /&gt;
Designing a cutting edge perceptual codec is a very daunting task. Xiph&lt;br /&gt;
is in the research stage on a new low-latency, general purpose audio codec,&lt;br /&gt;
code-named &amp;quot;Ghost&amp;quot;. This is basically a &amp;quot;code assistant&amp;quot; position, where you&lt;br /&gt;
will be asked to implement, test, and give feedback on ideas from Christopher&lt;br /&gt;
Montgomery, designer of the Ogg Vorbis format. Be prepared to learn a lot about&lt;br /&gt;
audio coding, or apply what you already know. While there&#039;s less &amp;quot;ownership&amp;quot;&lt;br /&gt;
potential in this project proposal, it will be a great opportunity to learn&lt;br /&gt;
about compression algorithm design, practice your programming chops, and learn&lt;br /&gt;
to work in team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Christopher &amp;quot;Monty&amp;quot; Montgomery, backup: Jean-Marc Valin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== OggMNG implementation ===&lt;br /&gt;
Implement the OggMNG decode support in [http://gstreamer.freedesktop.org/dev/ gstreamer] and/or [http://www.illiminable.com/ogg/ illi&#039;s dshow filters].&lt;br /&gt;
Implement encoding support in based on [http://www.advogato.org/person/company/diary.html?start=18 byzanz] or [http://live.gnome.org/Istanbul Istanbul]. Bonus points for&lt;br /&gt;
overlay support. Details on the OggMNG specifications [http://wiki.xiph.org/index.php/OggMNG here]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentors: Mike Smith, Ralph Giles&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Theora reference encoder quality optimization ===&lt;br /&gt;
The [http://theora.org/download.html libtheora] encoder could make more use of some features present in the spec&lt;br /&gt;
but not currently implemented in the encoder. This is a little open ended, but&lt;br /&gt;
suggestions are: quant matrix tuning, per-block qi choice, 4:2:2 and 4:4:4 chroma&lt;br /&gt;
support.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Ralph Giles, backup: Timothy Terriberry&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Subtitle Definition ===&lt;br /&gt;
There has been a long-standing need for the introduction of subtitles into Ogg. Several means have been suggested and various implementations exist. However, there has been no standard way that is supported by Xiph at this stage.&lt;br /&gt;
&lt;br /&gt;
The [http://annodex.net/TR/draft-pfeiffer-cmml-03.html CMML] format with its time-aligned means of interleaving text into Ogg bitstreams is a platform on which we would very much like to define a standard means of including subtitles.&lt;br /&gt;
&lt;br /&gt;
In this project, a standard means of interleaving subtitles (as found on DVDs or in srt files) into Ogg will be defined using CMML.&lt;br /&gt;
&lt;br /&gt;
The project requires to make changes to the CMML definition and extend it in several ways. CMML needs to have a valid XML schema or DTD definition associated with it, so that standard XML tools will parse it. The associated documentation should then be updated and software written to put e.g. a srt file into CMML inside Ogg. If there is enough time, it would also be good to implement support for this format in a media player such as vlc or mplayer or xine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Silvia Pfeiffer, backup: Conrad Parker&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Theora support in ekiga ===&lt;br /&gt;
Implement support for Theora as a video codec in the [http://www.gnomemeeting.org/ ekiga] chat application.&lt;br /&gt;
Overlaps with [http://live.gnome.org/SummerOfCode2006/Ideas GNOME].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Ralph Giles&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== MXF support in gstreamer ===&lt;br /&gt;
Implement an [http://www.digitalpreservation.gov/formats/fdd/fdd000013.shtml MXF] mux/demux for [http://gstreamer.freedesktop.org/dev/ gstreamer], with mappings for [http://xiph.org/vorbis/ Vorbis] and [http://xiph.org/theora Theora].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentors: Christian Schaller, Mike Smith&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Cascading Style Sheet support for CMML in GStreamer ===&lt;br /&gt;
&lt;br /&gt;
Implement support for [http://www.w3.org/Style/CSS/ Cascading Style Sheets] to add styling and positioning hints to&lt;br /&gt;
[http://annodex.net/TR/draft-pfeiffer-cmml-03.html CMML] text overlays on [http://xiph.org/theora Theora] video. Doing so allows for advanced titling features visually similar to TV-style news headlines, sports scores, and scrolling text. The advantage over conventional &amp;quot;burnt-in&amp;quot; titling is that the stylesheet-driven approach is machine-readable, allowing indexing for search and improved accessibility.&lt;br /&gt;
&lt;br /&gt;
The project involves:&lt;br /&gt;
# YUV compositing support in the [http://gstreamer.freedesktop.org/data/doc/gstreamer/0.10.1/gst-plugins-base-plugins/html/gst-plugins-base-plugins-textoverlay.html textoverlay] plugin in [http://gstreamer.freedesktop.org/dev/ gstreamer] in order to complete the low-level support for color and font attributes. Textoverlay already includes partial support for [http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html pango text], but lacks the necessary colorspace conversions. This portion of the project necessarily involves C programming.&lt;br /&gt;
# Implementation of a test application to playback video marked up with CSS titling hints. It is recommended that this portion of the project be implemented in a higher-level language for which GStreamer support and CSS parsing libraries exist, such as Python, Ruby or Haskell.&lt;br /&gt;
&lt;br /&gt;
Further work could include support for style sheets in liboggplay / Firefox, or direct support for style sheet retrieval and rendering in GStreamer (via the [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-cmmldec.html  cmmldec] plugin and/or a new style-sheet-aware textoverlay plugin).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Conrad Parker, backup: Mike Smith, Silvia Pfeiffer&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Hardware implementation of Theora decoding ===&lt;br /&gt;
Working on a hardware theora decoder, that can be used in embedded&lt;br /&gt;
devices, dvd players and video pods. Presumedly GPL verilog source&lt;br /&gt;
to run on an FPGA. See http://sourceforge.net/projects/elphel/ for a rough encoder implementation. This was a successful project in 2006.&lt;br /&gt;
&lt;br /&gt;
=== Intel to AT&amp;amp;T x86 assembly translation ===&lt;br /&gt;
There is a general need for cross platform projects to be able to compile the same asm accelleration code on both GCC and MSVC. Unfortunately, at least of x86, they have incompatible assembly formats. Currently people either convert one to the other by hand (a maintenance nightmare) or require an external compile/assemble step on one or the other platform.&lt;br /&gt;
&lt;br /&gt;
Start with the (unmaintained?) [http://www.niksula.hut.fi/~mtiihone/intel2gas/ intel2gas] script. Spruce it up to support all of recent MMX, SSE, SSE2, SSE3 instructions. Then implement the reverse translation. Once both are working, write some glue code so it can be easily used as part of a GNU autotools build to derive one set of source from the other at build or package time.&lt;br /&gt;
&lt;br /&gt;
=== Speex and FLAC encoders in Xiph QuickTime Components ===&lt;br /&gt;
Implement Speex and FLAC [http://developer.apple.com/documentation/MusicAudio/Reference/CoreAudio/index.html Core Audio] encoders.&lt;br /&gt;
&lt;br /&gt;
[http://xiph.org/quicktime/ XiphQT] has a Vorbis encoder component that could be used as a reference and starting point.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Arek Korbik&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== New vocoder for Speex ===&lt;br /&gt;
Speex currently has a very low bit-rate (2.15 kbps) mode that is implemented as a trivial vocoder. This mode has four &amp;quot;reserved&amp;quot; bits per frame, which means it would be possible to transmit more information. The idea of this project would be to make use of these bits to improve the quality of the 2.15 kbps mode. Changes to both the encoder and the decoder are allowed, provided that they are compatible with older version. This means that the new bit-stream should be decodable by the old decoder with only minor loss in quality. This still leaves plenty of room for improvement. Requires signal processing knowledge.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Jean-Marc Valin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== New Speex VAD/VBR code ===&lt;br /&gt;
The current Speex VAD/VBR code is a quick hack, put together a long time ago. This project would consist of rewriting it to perform much better under all kinds of conditions. Requires signal processing knowledge.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Jean-Marc Valin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== rehuff: a tool to losslessly compress Vorbis files ===&lt;br /&gt;
Would be nice to have an updated version of &amp;quot;rehuff&amp;quot;, a tool to losslessly compress Vorbis files. There were an experimental version of it (see [http://lists.xiph.org/pipermail/vorbis-dev/2006-August/018522.html rehuff status]), but had some limits:&lt;br /&gt;
* it&#039;s not free software;&lt;br /&gt;
* it has a bug causing the rehuffed file can&#039;t correctly seek;&lt;br /&gt;
* it works only with stereo files.&lt;br /&gt;
&lt;br /&gt;
Would be nice to have an updated rehuff, without the previous limits, and with a library part that will be included in libvorbisenc, so all encoders could use it (rehuff binary, oggenc, ...).&lt;br /&gt;
&#039;&#039;Not an official Xiph.org project, only a user proposed idea.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Ogg and Annodex integration into open source web Content Management Systems ===&lt;br /&gt;
The goal of this project is to make the use of ogg theora video in existing CMSs as easy as possible. &lt;br /&gt;
The project would consist of integrating in browser playback and structured cmml metadata into existing CMSs like mediaWiki, drupal or wordpress. &lt;br /&gt;
&lt;br /&gt;
In browser playback support will be handled by vlc or java cortado plugin and then liboggplay &amp;amp; native browser decoding as that project matures. [http://metavid.ucsc.edu/wiki/index.php/Mv_embed mv_embed] may be a starting point for client plugin detection. &lt;br /&gt;
The extension package should also handle thumbnail generation via mplayer or ffmpeg, and ideally support transcodeing via shell calls to ffmpeg2theora. Meta data attributes for the video in the CMS could be exportable as CMML. (a standardized xml format for tagging continues video)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Michael Dale&#039;&#039;, &#039;&#039;backup: Silvia Pfeiffer&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== OggPlay: Time Offset Acceleration ===&lt;br /&gt;
&lt;br /&gt;
OggPlay is a new library that enables developers to drop ogg media support into applications.  OggPlay will be used to implement native Ogg/Annodex support in Firefox, and supports a range of features including playing Oggs provided in TCP streams.&lt;br /&gt;
&lt;br /&gt;
This project involves adding time offset optimisation support to OggPlay in TCP mode.  Upon successful completion, applications will be able to notify the library of &amp;quot;interesting&amp;quot; time regions of the file, either at the current time point or in the past or future.  The library in turn will ensure that these regions are pinned in local memory or on disk using a combination of compressed stream and uncompressed frames.  If the application later attempts to seek to a pinned time region, then access to the stream at that point will be much faster than other regions.&lt;br /&gt;
&lt;br /&gt;
Time offset acceleration will be useful to projects such as Annodex, which allows annotation of time regions (&#039;clips&#039;) in Ogg, as well as direct access to individual clips over the WWW, URL-based naming of clips, and linking between clips.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mentor: Shane Stephens&#039;&#039;, &#039;&#039;backups: Marcin Lubonski, Michael Martin&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Guidelines for Applying ==&lt;br /&gt;
&lt;br /&gt;
Remember that many people will apply to work on the Summer of Code.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that those of us evaluating your application do not know you, we do not know what kind of &lt;br /&gt;
experience you have, we do not know what you have done in the past and we have to pick the best people &lt;br /&gt;
suited for a particular task.&lt;br /&gt;
&lt;br /&gt;
Hence, it is very important that you tell us in your email why you should be considered to implement a &lt;br /&gt;
particular project. Please use the application template at [[Summer of Code Applications]] as a starting point.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
*[[CodingGuidelines]]&lt;br /&gt;
*[[MIT approach to design and implementation]]&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlay&amp;diff=6420</id>
		<title>OggPlay</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlay&amp;diff=6420"/>
		<updated>2007-03-06T22:51:11Z</updated>

		<summary type="html">&lt;p&gt;Shans: /* OggPlay */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OggPlay is a library designed to allow drop-in playback of Xiph.Org media in an application.  OggPlay handles demuxing and decoding, generates timestamps for raw data, maintains synchronisation across multiple streams, and provides a lock-free buffer implementation for easy multithreading.&lt;br /&gt;
&lt;br /&gt;
OggPlay is a &#039;&#039;&#039;work in progress&#039;&#039;&#039;: the first release should be availably by mid-2007.&lt;br /&gt;
&lt;br /&gt;
Currently, OggPlay is hosted [http://www.annodex.net here], although there are plans to move hosting over to the Xiph.Org servers.  SVN access is available through http://svn.annodex.net/liboggplay/trunk.&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=OggPlay&amp;diff=6419</id>
		<title>OggPlay</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=OggPlay&amp;diff=6419"/>
		<updated>2007-03-06T22:50:46Z</updated>

		<summary type="html">&lt;p&gt;Shans: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OggPlay =&lt;br /&gt;
&lt;br /&gt;
OggPlay is a library designed to allow drop-in playback of Xiph.Org media in an application.  OggPlay handles demuxing and decoding, generates timestamps for raw data, maintains synchronisation across multiple streams, and provides a lock-free buffer implementation for easy multithreading.&lt;br /&gt;
&lt;br /&gt;
OggPlay is a &#039;&#039;&#039;work in progress&#039;&#039;&#039;: the first release should be availably by mid-2007.&lt;br /&gt;
&lt;br /&gt;
Currently, OggPlay is hosted [http://www.annodex.net here], although there are plans to move hosting over to the Xiph.Org servers.  SVN access is available through http://svn.annodex.net/liboggplay/trunk.&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
	<entry>
		<id>https://wiki.xiph.org/index.php?title=Main_Page&amp;diff=6418</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.xiph.org/index.php?title=Main_Page&amp;diff=6418"/>
		<updated>2007-03-06T22:41:04Z</updated>

		<summary type="html">&lt;p&gt;Shans: /* Software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In an effort to bring open-source ideals to the world of multimedia the [[Xiph.Org Foundation]] develops a multitude of amazing products.  This wiki describes our free and open protocols and software.&lt;br /&gt;
&lt;br /&gt;
= Demonstrations of Xiph technologies =&lt;br /&gt;
&lt;br /&gt;
Want to hear or see Xiph in action?  These projects are using our codecs, formats, or libraries.&lt;br /&gt;
&lt;br /&gt;
* [[VorbisStreams]]: Stations streaming with the [[Vorbis]] codec&lt;br /&gt;
* [[Games that use Vorbis]]: Games using the Vorbis codec for music or sound effects&lt;br /&gt;
* [[VorbisHardware]]: Hardware players using the Vorbis codec&lt;br /&gt;
* [[VorbisSoftwarePlayers]]: list of media players with out-of-box support for Ogg Vorbis&lt;br /&gt;
* [[List of Theora videos]]: Available videos encoded with [[Theora]]&lt;br /&gt;
&lt;br /&gt;
= Projects/Formats =&lt;br /&gt;
&lt;br /&gt;
== Container Formats ==&lt;br /&gt;
&lt;br /&gt;
* [[Ogg]]: Media container. This is our native format and the recommended container for Xiph codecs.&lt;br /&gt;
* [[Ogg Skeleton]]: Skeleton information on all logical content bitstreams in Ogg.&lt;br /&gt;
* [[SpeexRTP]]: RTP payload format for voice&lt;br /&gt;
* [[VorbisRTP]]: RTP payload format for general audio&lt;br /&gt;
* [[TheoraRTP]]: RTP payload format for video&lt;br /&gt;
* [[XSPF]]: XML playlist format&lt;br /&gt;
&lt;br /&gt;
== Codecs ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Compressed Audio/Video Codecs:&#039;&#039;&#039;&lt;br /&gt;
** [[Vorbis]]: Audio codec with a [[Tremor|fixed point decoder]]&lt;br /&gt;
** [[Theora]]: Video codec&lt;br /&gt;
** [[FLAC]]: Free Lossless Audio Codec&lt;br /&gt;
** [[Speex]]: Speech codec&lt;br /&gt;
* &#039;&#039;&#039;Timed Text/Metadata Codecs:&#039;&#039;&#039;&lt;br /&gt;
** [[CMML]]: Continuous Media Markup Language, used for [http://www.annodex.net/ Annodex] and subtitles (xine, vlc, gstreamer, and DirectShow support)&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Software for distributing media&#039;&#039;&#039;&lt;br /&gt;
** [[Icecast]]: Streaming server&lt;br /&gt;
** [[Ices]]: Source client for Icecast servers&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Libraries&#039;&#039;&#039;&lt;br /&gt;
** [[OggPlay]]: library for synchronised xiph media playback&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Other software&#039;&#039;&#039;&lt;br /&gt;
** [[OggComponent/VorbisComponent]]: Wrappers to integrate Ogg-Vorbis into Mac OS X (does not yet support encoding)&lt;br /&gt;
&lt;br /&gt;
== Promotional campaigns/events ==&lt;br /&gt;
&lt;br /&gt;
*[[MailOgging]]: project that provides templates for anyone willing to contact a company requesting them to add support for Xiph formats.&lt;br /&gt;
&lt;br /&gt;
== Work in Progress ==&lt;br /&gt;
* [[Work In Progress]]: codecs and software still in the research and development stages.&lt;br /&gt;
* [[Todo]]: To-do list for various Xiph.Org project.&lt;br /&gt;
&lt;br /&gt;
= Project management =&lt;br /&gt;
&lt;br /&gt;
* [[AdminProcesses]]&lt;br /&gt;
* [[MonthlyMeeting]]: page with information on Xiph&#039;s MonthlyMeeting&lt;br /&gt;
* [[MailingLists]]: list of Xiph&#039;s mailing lists&lt;br /&gt;
* [[Bounties]]: list of bounties that you can take to improve Xiph&#039;s projects&lt;br /&gt;
* [[HyperFish]]&lt;br /&gt;
&lt;br /&gt;
= Resources for Video and Audio programmers =&lt;br /&gt;
&lt;br /&gt;
* [[Ambisonics]]: page with technical information on Ambisonics&lt;br /&gt;
* [[Resources and papers on Audio, Music and Speech|Courses and papers on Audio, Music and Speech]]: page with links to MIT and other University&#039;s content&lt;br /&gt;
&lt;br /&gt;
= Wiki internal =&lt;br /&gt;
&lt;br /&gt;
* [[Sandbox]]: Testbed for testing editing skills&lt;br /&gt;
* [[Translations]]: What about some translation work&lt;br /&gt;
* [[XiphWiki:Copyrights]]: License used for content on this wiki (i.e. CC-BY-SA)&lt;/div&gt;</summary>
		<author><name>Shans</name></author>
	</entry>
</feed>