Merge pull request #373 from pedrobmarin/adjust-playback-to-old-recordings
Adjusting playback to work with old recordings
This commit is contained in:
commit
f6ee9b281f
@ -118,22 +118,30 @@ function removeSlideChangeAttribute() {
|
|||||||
|
|
||||||
function mustShowDesktopVideo(time) {
|
function mustShowDesktopVideo(time) {
|
||||||
var canShow = false;
|
var canShow = false;
|
||||||
for (var m = 0; m < deskshareTimes.length; m++) {
|
if (isThereDeskshareVideo()) {
|
||||||
var start_timestamp = deskshareTimes[m][0];
|
for (var m = 0; m < deskshareTimes.length; m++) {
|
||||||
var stop_timestamp = deskshareTimes[m][1];
|
var start_timestamp = deskshareTimes[m][0];
|
||||||
|
var stop_timestamp = deskshareTimes[m][1];
|
||||||
|
|
||||||
if(time >= start_timestamp && time <= stop_timestamp)
|
if(time >= start_timestamp && time <= stop_timestamp)
|
||||||
canShow = true;
|
canShow = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return canShow;
|
return canShow;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isThereDeskshareVideo() {
|
function isThereDeskshareVideo() {
|
||||||
return deskshareTimes.length > 0;
|
var deskshareVideo = document.getElementById("deskshare-video");
|
||||||
|
if (deskshareVideo != null) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resyncVideos() {
|
function resyncVideos() {
|
||||||
|
if (!isThereDeskshareVideo()) return;
|
||||||
var currentTime = Popcorn('#video').currentTime();
|
var currentTime = Popcorn('#video').currentTime();
|
||||||
var currentDeskshareVideoTime = Popcorn("#deskshare-video").currentTime();
|
var currentDeskshareVideoTime = Popcorn("#deskshare-video").currentTime();
|
||||||
if (Math.abs(currentTime - currentDeskshareVideoTime) >= 0.1)
|
if (Math.abs(currentTime - currentDeskshareVideoTime) >= 0.1)
|
||||||
@ -158,10 +166,8 @@ function handlePresentationAreaContent(time) {
|
|||||||
sharingDesktop = false;
|
sharingDesktop = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isThereDeskshareVideo()) {
|
resyncVideos();
|
||||||
resyncVideos();
|
resizeDeshareVideo();
|
||||||
resizeDeshareVideo();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - END OF JAVASCRIPT FUNCTIONS - - - //
|
// - - - END OF JAVASCRIPT FUNCTIONS - - - //
|
||||||
@ -626,13 +632,18 @@ document.addEventListener('media-ready', function(event) {
|
|||||||
if ((audioReady || videoReady) && deskshareReady && svgReady) {
|
if ((audioReady || videoReady) && deskshareReady && svgReady) {
|
||||||
runPopcorn();
|
runPopcorn();
|
||||||
|
|
||||||
generateThumbnails();
|
if (firstLoad) initPopcorn();
|
||||||
|
|
||||||
var p = Popcorn("#video");
|
|
||||||
p.currentTime(defineStartTime());
|
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
function initPopcorn() {
|
||||||
|
firstLoad = false;
|
||||||
|
generateThumbnails();
|
||||||
|
|
||||||
|
var p = Popcorn("#video");
|
||||||
|
p.currentTime(defineStartTime());
|
||||||
|
}
|
||||||
|
|
||||||
svgobj.addEventListener('load', function() {
|
svgobj.addEventListener('load', function() {
|
||||||
console.log("got svgobj 'load' event");
|
console.log("got svgobj 'load' event");
|
||||||
document.dispatchEvent(new CustomEvent('media-ready', {'detail': 'svg'}));
|
document.dispatchEvent(new CustomEvent('media-ready', {'detail': 'svg'}));
|
||||||
@ -827,19 +838,17 @@ var resizeSlides = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var resizeDeshareVideo = function() {
|
var resizeDeshareVideo = function() {
|
||||||
|
if (!isThereDeskshareVideo()) return;
|
||||||
var deskshareVideo = document.getElementById("deskshare-video");
|
var deskshareVideo = document.getElementById("deskshare-video");
|
||||||
|
var $deskhareVideo = $("#deskshare-video");
|
||||||
|
|
||||||
if (deskshareVideo != null) {
|
var videoWidth = parseInt(deskshareVideo.videoWidth, 10);
|
||||||
var $deskhareVideo = $("#deskshare-video");
|
var videoHeight = parseInt(deskshareVideo.videoHeight, 10);
|
||||||
|
|
||||||
var videoWidth = parseInt(deskshareVideo.videoWidth, 10);
|
var aspectRatio = videoWidth/videoHeight;
|
||||||
var videoHeight = parseInt(deskshareVideo.videoHeight, 10);
|
var max = aspectRatio * $deskhareVideo.parent().outerHeight();
|
||||||
|
$deskhareVideo.css("max-width", max);
|
||||||
|
|
||||||
var aspectRatio = videoWidth/videoHeight;
|
var height = $deskhareVideo.parent().width() / aspectRatio;
|
||||||
var max = aspectRatio * $deskhareVideo.parent().outerHeight();
|
$deskhareVideo.css("max-height", height);
|
||||||
$deskhareVideo.css("max-width", max);
|
|
||||||
|
|
||||||
var height = $deskhareVideo.parent().width() / aspectRatio;
|
|
||||||
$deskhareVideo.css("max-height", height);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
@ -118,22 +118,30 @@ function removeSlideChangeAttribute() {
|
|||||||
|
|
||||||
function mustShowDesktopVideo(time) {
|
function mustShowDesktopVideo(time) {
|
||||||
var canShow = false;
|
var canShow = false;
|
||||||
for (var m = 0; m < deskshareTimes.length; m++) {
|
if (isThereDeskshareVideo()) {
|
||||||
var start_timestamp = deskshareTimes[m][0];
|
for (var m = 0; m < deskshareTimes.length; m++) {
|
||||||
var stop_timestamp = deskshareTimes[m][1];
|
var start_timestamp = deskshareTimes[m][0];
|
||||||
|
var stop_timestamp = deskshareTimes[m][1];
|
||||||
|
|
||||||
if(time >= start_timestamp && time <= stop_timestamp)
|
if(time >= start_timestamp && time <= stop_timestamp)
|
||||||
canShow = true;
|
canShow = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return canShow;
|
return canShow;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isThereDeskshareVideo() {
|
function isThereDeskshareVideo() {
|
||||||
return deskshareTimes.length > 0;
|
var deskshareVideo = document.getElementById("deskshare-video");
|
||||||
|
if (deskshareVideo != null) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resyncVideos() {
|
function resyncVideos() {
|
||||||
|
if (!isThereDeskshareVideo()) return;
|
||||||
var currentTime = Popcorn('#video').currentTime();
|
var currentTime = Popcorn('#video').currentTime();
|
||||||
var currentDeskshareVideoTime = Popcorn("#deskshare-video").currentTime();
|
var currentDeskshareVideoTime = Popcorn("#deskshare-video").currentTime();
|
||||||
if (Math.abs(currentTime - currentDeskshareVideoTime) >= 0.1)
|
if (Math.abs(currentTime - currentDeskshareVideoTime) >= 0.1)
|
||||||
@ -158,10 +166,8 @@ function handlePresentationAreaContent(time) {
|
|||||||
sharingDesktop = false;
|
sharingDesktop = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isThereDeskshareVideo()) {
|
resyncVideos();
|
||||||
resyncVideos();
|
resizeDeshareVideo();
|
||||||
resizeDeshareVideo();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - END OF JAVASCRIPT FUNCTIONS - - - //
|
// - - - END OF JAVASCRIPT FUNCTIONS - - - //
|
||||||
@ -626,13 +632,18 @@ document.addEventListener('media-ready', function(event) {
|
|||||||
if ((audioReady || videoReady) && deskshareReady && svgReady) {
|
if ((audioReady || videoReady) && deskshareReady && svgReady) {
|
||||||
runPopcorn();
|
runPopcorn();
|
||||||
|
|
||||||
generateThumbnails();
|
if (firstLoad) initPopcorn();
|
||||||
|
|
||||||
var p = Popcorn("#video");
|
|
||||||
p.currentTime(defineStartTime());
|
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
function initPopcorn() {
|
||||||
|
firstLoad = false;
|
||||||
|
generateThumbnails();
|
||||||
|
|
||||||
|
var p = Popcorn("#video");
|
||||||
|
p.currentTime(defineStartTime());
|
||||||
|
}
|
||||||
|
|
||||||
svgobj.addEventListener('load', function() {
|
svgobj.addEventListener('load', function() {
|
||||||
console.log("got svgobj 'load' event");
|
console.log("got svgobj 'load' event");
|
||||||
document.dispatchEvent(new CustomEvent('media-ready', {'detail': 'svg'}));
|
document.dispatchEvent(new CustomEvent('media-ready', {'detail': 'svg'}));
|
||||||
@ -827,19 +838,17 @@ var resizeSlides = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var resizeDeshareVideo = function() {
|
var resizeDeshareVideo = function() {
|
||||||
|
if (!isThereDeskshareVideo()) return;
|
||||||
var deskshareVideo = document.getElementById("deskshare-video");
|
var deskshareVideo = document.getElementById("deskshare-video");
|
||||||
|
var $deskhareVideo = $("#deskshare-video");
|
||||||
|
|
||||||
if (deskshareVideo != null) {
|
var videoWidth = parseInt(deskshareVideo.videoWidth, 10);
|
||||||
var $deskhareVideo = $("#deskshare-video");
|
var videoHeight = parseInt(deskshareVideo.videoHeight, 10);
|
||||||
|
|
||||||
var videoWidth = parseInt(deskshareVideo.videoWidth, 10);
|
var aspectRatio = videoWidth/videoHeight;
|
||||||
var videoHeight = parseInt(deskshareVideo.videoHeight, 10);
|
var max = aspectRatio * $deskhareVideo.parent().outerHeight();
|
||||||
|
$deskhareVideo.css("max-width", max);
|
||||||
|
|
||||||
var aspectRatio = videoWidth/videoHeight;
|
var height = $deskhareVideo.parent().width() / aspectRatio;
|
||||||
var max = aspectRatio * $deskhareVideo.parent().outerHeight();
|
$deskhareVideo.css("max-height", height);
|
||||||
$deskhareVideo.css("max-width", max);
|
|
||||||
|
|
||||||
var height = $deskhareVideo.parent().width() / aspectRatio;
|
|
||||||
$deskhareVideo.css("max-height", height);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user