Add JWPlayer support
This commit is contained in:
parent
4bdbac3dbd
commit
7f7ae16138
7 changed files with 61 additions and 17 deletions
|
|
@ -427,6 +427,10 @@ function parseVideoURL(url){
|
|||
url = url.trim()
|
||||
if(typeof(url) != "string")
|
||||
return null;
|
||||
if(url.indexOf("jw:") == 0) {
|
||||
url = url.substring(3);
|
||||
return [url, "jw"];
|
||||
}
|
||||
if(url.indexOf("rtmp://") == 0) {
|
||||
return [url, "rt"];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ var Media = function(data) {
|
|||
case "rt":
|
||||
this.initRTMP();
|
||||
break;
|
||||
case "jw":
|
||||
this.initJWPlayer();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -278,6 +281,31 @@ Media.prototype.initRTMP = function() {
|
|||
this.seek = function() { }
|
||||
}
|
||||
|
||||
Media.prototype.initJWPlayer = function() {
|
||||
this.removeOld();
|
||||
|
||||
jwplayer("ytapiplayer").setup({
|
||||
file: this.id,
|
||||
width: VWIDTH,
|
||||
height: VHEIGHT,
|
||||
autostart: true
|
||||
});
|
||||
setTimeout(function() {$("#ytapiplayer_logo").remove();}, 1000);
|
||||
|
||||
this.load = function(data) {
|
||||
this.id = data.id;
|
||||
this.initJWPlayer();
|
||||
}
|
||||
|
||||
this.pause = function() { }
|
||||
|
||||
this.play = function() { }
|
||||
|
||||
this.getTime = function() { }
|
||||
|
||||
this.seek = function() { }
|
||||
}
|
||||
|
||||
Media.prototype.update = function(data) {
|
||||
if(data.id != this.id) {
|
||||
if(data.currentTime < 0) {
|
||||
|
|
|
|||
|
|
@ -130,15 +130,17 @@
|
|||
<li>http://www.dailymotion.com/video/(videoid)</li>
|
||||
<li>http://www.twitch.tv/(channel)</li>
|
||||
<li>http://www.livestream.com/(channel)</li>
|
||||
<li>rtmp://(stream url)</li>
|
||||
<li>jw:(stream url) - uses a JWPlayer embed (use this for audio streams)
|
||||
</ul>
|
||||
You can also queue multiple items at once by separating the URLs with commas.
|
||||
<div>
|
||||
<input type="text" id="mediaurl" style="margin:auto;">
|
||||
<div class="btn-group">
|
||||
<button class="btn">Queue Next</button>
|
||||
<button class="btn">Queue @ End</button>
|
||||
<button class="btn">Next</button>
|
||||
<button class="btn">End</button>
|
||||
</div>
|
||||
<button class="btn btn-danger">Voteskip</button>
|
||||
<button class="btn btn-block">Voteskip</button>
|
||||
</div>
|
||||
<p>Below is an example of an entry in the playlist. Please note the control buttons only appear if you are a moderator or if the queue is unlocked. The button with vertical arrows is for moving videos in the playlist. Click and hold the button and drag the mouse up and down to move the video in the playlist. The red "X" button will remove the video from the playlist. The green play button will jump the playlist to that video. The "Next" button will move the video so that it plays after the current video.
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@
|
|||
|
||||
<!-- APIs -->
|
||||
<script src="http://api.dmcdn.net/all.js"></script>
|
||||
<script src="http://jwpsrv.com/library/QouFCLBMEeKC+CIACpYGxA.js"></script>
|
||||
<script src="./assets/js/sc.js"></script>
|
||||
<script src="./assets/js/froogaloop.min.js"></script>
|
||||
<script src="./assets/js/swf.js"></script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue