Embedded Player/en

Материал из Ace Stream
(Различия между версиями)
Перейти к: навигация, поиск
(Новая страница: «Embedded Player/en»)
 
Строка 1: Строка 1:
Embedded Player/en
+
== Demo version ==
  +
  +
http://torrentstream.org/test-popup.html
  +
  +
== Links required to embed the player to site's page ==
  +
  +
To embed the player to 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>
  +
<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></nowiki></tt>
  +
  +
== 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 when pressing this button. This function takes one parameter: content identifier (content id). Example:
  +
  +
<tt><input type="button" value="open" onclick="showPlayer('fa8ddccad4aea0a41d000a4f243c11dee99c4087');" /> </tt>

Версия 13:48, 21 декабря 2012

Demo version

http://torrentstream.org/test-popup.html

Links required to embed the player to site's page

To embed the player to 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 when pressing this button. This function takes one parameter: content identifier (content id). Example:

<input type="button" value="open" onclick="showPlayer('fa8ddccad4aea0a41d000a4f243c11dee99c4087');" /> 
Персональные инструменты
На других языках