UNPKG

vlitejs

Version:

vLitejs is a fast and lightweight Javascript library for customizing HTML5 and Youtube video players in Javascript with a minimalist theme

1,964 lines (346 loc) 18.1 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: module:vLite/Player/PlayerHtml5</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: module:vLite/Player/PlayerHtml5</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>module:vLite/Player/PlayerHtml5<span class="signature">(selector, options, callback)</span><span class="type-signature"></span></h2> </header> <article> <div class="container-overview"> <h4 class="name" id="module:vLite/Player/PlayerHtml5"><span class="type-signature"></span>new module:vLite/Player/PlayerHtml5<span class="signature">(selector, options, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Instanciate the constructor</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>selector</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">Object</span> </td> <td class="description last"><p>CSS selector or query selector</p></td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Player options</p></td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>Callback function executed when the player is ready</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line15">line 15</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="bindSpecificEvents"><span class="type-signature"></span>bindSpecificEvents<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Create event listeners All listeners are created on class properties to facilitate the deletion of events</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line82">line 82</a> </li></ul></dd> </dl> <h4 class="name" id="getCurrentTime"><span class="type-signature"></span>getCurrentTime<span class="signature">()</span><span class="type-signature"> &rarr; {Float|Integer}</span></h4> <div class="description"> <p>Get the player current time</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line135">line 135</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Current time of the video</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Float</span> | <span class="param-type">Integer</span> </dd> </dl> <h4 class="name" id="getDuration"><span class="type-signature"></span>getDuration<span class="signature">()</span><span class="type-signature"> &rarr; {Float|Integer}</span></h4> <div class="description"> <p>Get the player duration</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line151">line 151</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Duration of the video</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Float</span> | <span class="param-type">Integer</span> </dd> </dl> <h4 class="name" id="getInstance"><span class="type-signature"></span>getInstance<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4> <div class="description"> <p>Get the player instance</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line127">line 127</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Video element</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> <h4 class="name" id="methodMute"><span class="type-signature"></span>methodMute<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Mute method of the player</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line180">line 180</a> </li></ul></dd> </dl> <h4 class="name" id="methodPause"><span class="type-signature"></span>methodPause<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Pause method of the player</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line173">line 173</a> </li></ul></dd> </dl> <h4 class="name" id="methodPlay"><span class="type-signature"></span>methodPlay<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Play method of the player</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line166">line 166</a> </li></ul></dd> </dl> <h4 class="name" id="methodUnMute"><span class="type-signature"></span>methodUnMute<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Unmute method of the player</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line187">line 187</a> </li></ul></dd> </dl> <h4 class="name" id="onPlayerReady"><span class="type-signature"></span>onPlayerReady<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Function executed when the player is ready</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line36">line 36</a> </li></ul></dd> </dl> <h4 class="name" id="onPlaying"><span class="type-signature"></span>onPlaying<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Function executed when the video is playing</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line201">line 201</a> </li></ul></dd> </dl> <h4 class="name" id="onProgressChanged"><span class="type-signature"></span>onProgressChanged<span class="signature">(e)</span><span class="type-signature"></span></h4> <div class="description"> <p>Function executed on the video progress changed</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>e</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Event listener datas</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line159">line 159</a> </li></ul></dd> </dl> <h4 class="name" id="onSeeked"><span class="type-signature"></span>onSeeked<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Function executed when the video seek is done</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line215">line 215</a> </li></ul></dd> </dl> <h4 class="name" id="onSeeking"><span class="type-signature"></span>onSeeking<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Function executed when the video is seeking</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line208">line 208</a> </li></ul></dd> </dl> <h4 class="name" id="onWaiting"><span class="type-signature"></span>onWaiting<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Function executed when the video is waiting</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line194">line 194</a> </li></ul></dd> </dl> <h4 class="name" id="setCurrentTime"><span class="type-signature"></span>setCurrentTime<span class="signature">(Current)</span><span class="type-signature"></span></h4> <div class="description"> <p>Set the new current time for the player</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>Current</code></td> <td class="type"> <span class="param-type">Float</span> | <span class="param-type">Integer</span> </td> <td class="description last"><p>time video</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line143">line 143</a> </li></ul></dd> </dl> <h4 class="name" id="unBindSpecificEvents"><span class="type-signature"></span>unBindSpecificEvents<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Unbind event listeners</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line222">line 222</a> </li></ul></dd> </dl> <h4 class="name" id="waitUntilVideoIsReady"><span class="type-signature"></span>waitUntilVideoIsReady<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4> <div class="description"> <p>Wait until the video is ready</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="player-html5.js.html">player-html5.js</a>, <a href="player-html5.js.html#line45">line 45</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Loading of the video with a Promise</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise</span> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-vLite_entrypoint.html">vLite/entrypoint</a></li><li><a href="module-vLite_Player.html">vLite/Player</a></li><li><a href="module-vLite_Player_PlayerHtml5.html">vLite/Player/PlayerHtml5</a></li><li><a href="module-vLite_Player_PlayerYoutube.html">vLite/Player/PlayerYoutube</a></li></ul><h3>Classes</h3><ul><li><a href="module-vLite_entrypoint.html">vLite/entrypoint</a></li><li><a href="module-vLite_Player.html">vLite/Player</a></li><li><a href="module-vLite_Player_PlayerHtml5.html">vLite/Player/PlayerHtml5</a></li><li><a href="module-vLite_Player_PlayerYoutube.html">vLite/Player/PlayerYoutube</a></li></ul><h3>Global</h3><ul><li><a href="global.html#vLitejs">vLitejs</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Tue Nov 19 2019 00:24:53 GMT+0100 (CET) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>