JWPlayer fixes

This commit is contained in:
calzoneman 2014-11-13 20:24:05 -06:00
parent 7310dabedf
commit 08f9aeaedb
2 changed files with 15 additions and 8 deletions

View File

@ -698,12 +698,17 @@ var JWPlayer = function (data) {
jwplayer("ytapiplayer").setup({
file: self.videoURL,
width: VWIDTH,
height: VHEIGHT,
width: "100%",
height: "100%",
autostart: true,
type: data.contentType
});
jwplayer().onReady(function() {
$("#ytapiplayer").addClass("embed-responsive-item");
handleVideoResize();
});
jwplayer().onPlay(function() {
self.paused = false;
if(CLIENT.leader)
@ -717,11 +722,17 @@ var JWPlayer = function (data) {
jwplayer().onComplete(function() {
socket.emit("playNext");
});
self.setVolume(VOLUME);
};
self.load = function (data) {
self.videoId = data.id;
if (data.url) {
self.videoURL = data.url;
} else {
self.videoURL = data.id;
}
self.videoLength = data.seconds;
self.init();
};

View File

@ -1647,7 +1647,6 @@ function handleWindowResize() {
}
function handleVideoResize() {
//console.trace();
var intv, ticks = 0;
var resize = function () {
if (++ticks > 10) clearInterval(intv);
@ -1655,12 +1654,11 @@ function handleVideoResize() {
clearInterval(intv);
var height = $("#ytapiplayer").height() - $("#chatline").outerHeight() - 2;
console.log(height);
$("#messagebuffer").height(height);
$("#userlist").height(height);
//$("#ytapiplayer").attr("height", VHEIGHT = $("#ytapiplayer").height());
//$("#ytapiplayer").attr("width", VWIDTH = $("#ytapiplayer").width());
$("#ytapiplayer").attr("height", VHEIGHT = $("#ytapiplayer").height());
$("#ytapiplayer").attr("width", VWIDTH = $("#ytapiplayer").width());
};
if ($("#ytapiplayer").height() > 0) resize();
@ -1668,9 +1666,7 @@ function handleVideoResize() {
}
$(window).resize(handleWindowResize);
//setInterval(function () { console.log($("#ytapiplayer").height()); }, 10);
handleWindowResize();
console.log('after');
function removeVideo() {
try {