Difference between revisions of "Embedded Player/en"
(→Button to start the player) |
|||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
http://torrentstream.org/test-popup.html | http://torrentstream.org/test-popup.html | ||
− | == Links required to embed the player | + | == Links required to embed the player into site's page == |
− | To embed the player | + | To embed the player into site's page, insert scripts and styles before the closing tag <tt></body></tt>. |
<tt><nowiki> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/ts/core.js"></script> | <tt><nowiki> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/ts/core.js"></script> | ||
Line 47: | Line 47: | ||
== Button to start the player == | == Button to start the player == | ||
− | After pasting all scripts and styles create a button or link that will launch the player. Previously declared function <tt>'''showPlayer()'''</tt> must be called | + | After pasting all scripts and styles create a button or link that will launch the player. Previously declared function <tt>'''showPlayer()'''</tt> must be called by clicking this button. This function takes one parameter: content identifier (content id). Example: |
<tt><input type="button" value="open" onclick="showPlayer('fa8ddccad4aea0a41d000a4f243c11dee99c4087');" /> </tt> | <tt><input type="button" value="open" onclick="showPlayer('fa8ddccad4aea0a41d000a4f243c11dee99c4087');" /> </tt> |
Latest revision as of 13:15, 24 December 2012
Demo version
http://torrentstream.org/test-popup.html
Links required to embed the player into site's page
To embed the player into site's page, insert scripts and styles before the closing tag </body>.
<script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/ts/core.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/jquery/jquery-1.7.min.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/jquery/jquery.mousewheel.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/jquery/jquery.easing.1.3.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/jquery/jquery-ui-1.8.9.custom.min.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/jquery/jquery.jscrollpane.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/jquery/jquery.scrollText.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/cufon/cufon.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/cufon/a_LCDNova_400.font.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/ts/player.js"></script> <script type="text/javascript" src="http://static.torrentstream.org/jsapi/js/lib/ts/controls.js"></script> <link type="text/css" rel="stylesheet" href="http://static.torrentstream.org/jsapi/css/ts-buttons.css" /> <link type="text/css" rel="stylesheet" href="http://static.torrentstream.org/jsapi/css/ts-controls-white.css" /> <script type="text/javascript"> var controls = new TorrentStream.Controls(null, { style: "ts-white-screen" }); function showPlayer(contentId) { controls.showPlayer(function() { try { var player = new TorrentStream.Player(this.getPluginContainer(), { debug: true, onLoad: function() { this.registerEventHandler(controls); controls.attachPlayer(this); this.loadPlayer(contentId); } }); } catch(e) { controls.onSystemMessage(e); } }); } </script>
Button to start the player
After pasting all scripts and styles create a button or link that will launch the player. Previously declared function showPlayer() must be called by clicking this button. This function takes one parameter: content identifier (content id). Example:
<input type="button" value="open" onclick="showPlayer('fa8ddccad4aea0a41d000a4f243c11dee99c4087');" />