Changes

Jump to: navigation, search

JavaScript Library

1 byte removed, 10:30, 21 November 2018
Guide
Ace Stream JavaScript Library provides tools to embed video player on web-pages with minimum effort.
== Example of using Ace Stream Javascript API to embed player on the page. Guide ==
First, add javascript library on the page (inside the <head> tag):
<tt><script src="//static.acestream.net/jsapi/acestream.min.js"></script></tt>
Then you can create the player with this code:
<tt><nowiki>
var playerContext player = null; AceStream.createPlayer("#player", { onLoad: function (playerplayerObj) { playerContext player = playerplayerObj; playerContext player.loadContentId("94c2fd8fb9bc8f2fc71a2cbe9d4b866f227a0209"); }, onError: function(err) { console.log("init: error: " + err); } });
</nowiki></tt>
Player is created in the HTML-container with id "player".
*<tt>loadDirectUrl(url)</tt> - load by direct content URL (this can be direct link to some video file, HLS stream or link supported by Ace Stream plugins: youtube, twitch etc).
Buttons You can create more than one player on the top of same web page. To do this you need to provide a separate HTML container for each player and call AceStream.createPlayer() method on each container. You can find example on the pages show how to use different content loading methodsdemo page.
== Demo ==Working example demo is available [http://acestream.net/demos/embedding/index.html here]
==Additional features==
== Roadmap ==
New JS API library consists of reusable javascript modules which are bundled with browserify. Currently only the bundled version is distributed, but we plan to prepare documentation for these modules and publish it along with the source code on github.
Modules will implement such functionality like:
* etc
== Legacy JS API Library ==The old version of JS API Library is still available. You can find test page and links [http://acestream.net/demos/embedding/index-legacy.html here.]

Navigation menu