Information

Information

0 && dvpCCEnabled) { var englishCaptions = captionsSelector.discover(“enter[value=en]”); englishCaptions.click on(); } } // ie 11 compliant operate DispatchDomEvent(title) { if (typeof title !== ‘string’) return; var e; if (typeof(Occasion) === ‘operate’) { e = new Occasion(title); } else { e = doc.createEvent(‘Occasion’); e.initEvent(title, true, true); } doc.dispatchEvent(e); } // DEFINE MULTI-BANDWIDTH BUTTON CONTROL MediaElementPlayer.prototype.buildmultiBandwidth = operate (participant, controls, layers, media) { var multiBandwidth = $(““).appendTo(controls);
mbOptions = $(“#multiBandwidthOptions”);
createMultiBandwithAnchors(currentVideoHeight);
multiBandwidth.hover(operate () {
mbOptions.present();
},
operate () {
mbOptions.cover();
});
};

// BUILD MULTI-BANDWIDTH PLAYER TOOL
operate createMultiBandwithAnchors(videoHeight) {
videoHeight = checkVideoHeight(videoHeight);
updateMultiBandwithAnchors(videoFilesObj, videoHeight);
}

// CHECK IF CURRENT VIDEO HEIGHT EXISTS
operate checkVideoHeight(heightToCheck) {
var index = videoFilesObj.size – 1;
tempHeight = videoFilesObj[index].top;
for (var i = 0; i 0) {
restartTimer = time;
}
}

// The container aspect is comparatively positioned. MediaElement js creates a completely
// positioned aspect inside. Completely positioned gadgets don’t respect the containment
// of dad or mum comparatively positioned parts. This ensures the heights are constrained.
operate calculateVideoHeight() {
if (debug) console.log(‘DVIDSPlayer() > calculateVideoHeight()’);
var playerHeight = $(‘.DVIDSVideoPlayerItem video’).top();
if (debug) console.log(‘DVIDSPlayer() > calculateVideoHeight’, playerHeight);
if (playerHeight) {
$(‘.DVIDSVideoPlayer .video-column, .DVIDSVideoPlayerItem, .DVIDSVideoPlayerItemPlaceHolder’).css(“min-height”, playerHeight + 20);
$(‘.DVIDSVideoPlayerItem .mejs__video, .DVIDSVideoPlayerItem video’).css(‘top’, playerHeight);
}
}

operate debounce(func, wait, speedy) {
var timeout;
return operate () {
var context = this, args = arguments;
var later = operate () {
timeout = null;
if (!speedy) func.apply(context, args);
};
var callNow = speedy && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
};

operate setAspectRatio() {
if (debug) console.log(‘DVIDSPlayer() > setAspectRatio()’);
// for portrait side ratio, want to attend until video is taking part in, then redetect top
var loopCount = 0;
var mainLoopId = setInterval(operate () {
loopCount++;
calculateVideoHeight();
if (loopCount > 10) {
clearInterval(mainLoopId);
}
if (debug) console.log(‘DVIDSPlayer() > setAspectRatio() > setInterval Operating’);
}, 500);
}

operate playVideo() {
doc.getElementById(‘videoPlayer677’).play();
setAspectRatio();
//var playButton = $(“.mejs-overlay-play”);
//if (playButton.dimension() != 0) {
// playButton.set off(“click on”);
//}
}

myPlayer = new MediaElementPlayer(‘videoPlayer677’, {
videoWidth: ‘100%’,
videoHeight: ‘100%’,
//enableAutosize: true,
pluginPath: “/DesktopModules/SharedLibrary/Plugins/MediaElement4.2.9/”,
options: [“playpause”, “progress”, “current”, “duration”, “tracks”, “multiBandwidth”, “volume”, “fullscreen”],
success: operate (mediaElement, domObject) {

mediaElement.addEventListener(‘taking part in’, operate (e) {
if (defaultButton.size) {
if (playEventButtonTriggered === false) {
defaultButton.cover();
hoverButton.cover();
playEventButtonTriggered = true;
}
}

if (playEventAlreadyTriggered === false) {
DVIDSVideoAnalytics.observe(‘play’, analyticsParams);
if(debug) {
console.debug(‘DVIDSVideoAnalytics PLAY EVENT’);
}
playEventAlreadyTriggered = true;

DynamicAnalytics.Ship(“DVIDS”, gaID, gaTitle, gaUrl);

}

});

mediaElement.addEventListener(‘play’, operate (e) {
if ($(“.mejs__controls”).is(“:hidden”) )
$(“.mejs__controls”).present();
// if overlay exists, cover it
if ($(“.mejs__layer.video-overlay”).size)
$(“.mejs__layer.video-overlay”).cover();
setAspectRatio();
});

mediaElement.addEventListener(‘ended’, operate (e) {

DVIDSVideoAnalytics.observe(‘ended’, analyticsParams);
if(debug) {
console.debug(‘DVIDSVideoAnalytics ENDED EVENT’);
}

//play subsequent media

});

//$(‘#videoPlayer677’).css({‘width’: ‘100%’, ‘top’:’100%’});

// EVENT LISTENER FOR WHEN VIDEO TIME HAS BEEN UPDATED
mediaElement.addEventListener(‘timeupdate’, operate (e) {

// IF VIDEO HAS NOT BEEN PLAYED AND SAVED POSITION IS GREATER THAN 0
if (!videoHasPlayed && restartTimer > 0) {

// SET THE START TIME FROM THE RELATION IN SECONDS
myPlayer.setCurrentTime(restartTimer);

// SET THE VIDEO HAS PLAYED FLAG AND CLEAR THE TIMER
// OTHERWISE KEEP CONTINUAL LOOP GOING BACK TO THIS TIME
// THIS EVENT GETS CALLED AROUND EVERY 250MS
videoHasPlayed = true;
restartTimer = 0;
}
}, false);

mediaElement.addEventListener(‘canplay’, operate (e) {
CheckCaptions();
}, false);

mediaElement.addEventListener(‘pause’, operate (e) {
if (defaultButton.size) {
defaultButton.removeAttr(“type”);
hoverButton.removeAttr(“type”);
playEventButtonTriggered = false;
}
}, false);

mbOptions.delegate(“a”, “click on”, operate () {
var obj = $(this);
if (obj.hasClass(“chosenMBLink”)) {
return false;
}
else {
mbOptions.discover(“a.chosenMBLink”).removeClass(“chosenMBLink”);
obj.addClass(“chosenMBLink”);
currentVideoHeight = obj.html().substring(0, obj.html().size – 1);
setPlayerSource(obj.attr(“fileurl”));
}
mbOptions.cover();
return false;
});
// ASSIGN CAPTIONS SELECTOR TO JQUERY OBJECT, SET CLICK DELEGATE AND TURN ON CAPTIONS IF PREVIOUSLY ENABLED
captionsSelector = $(“div.mejs-captions-selector”);
captionsSelector.delegate(“enter:radio”, “click on”, operate () {
var lang = this.worth;
if (lang == “none”) {
dvpCCEnabled = false;
}
else {
dvpCCEnabled = true;
}
});
turnOnCaptionsIfEnabled();
}
});

$window.on(“resize”, operate () {
var debouncedFn = debounce(calculateVideoHeight, 250);
debouncedFn();
});

// AUTOMATICALLY PLAY VIDEO IF ID PASSED OR VIDEO CLICKED
if (false) {
playVideo();
//doc.getElementById(‘videoPlayer677’).play();
}
});

operate updateMultiBandwithAnchors(recordsdata, videoHeight) {
var mbOptions = $(“#multiBandwidthOptions”);
var multiBandwidthHTML = [];
for (var i = 0; i ” + recordsdata[i].top + “p”);
}
else {
if (recordsdata[i].top != recordsdata[i+1].top) {
multiBandwidthHTML.unshift(“” + recordsdata[i].top + “p”); } } } multiBandwidthHTML.push(“”); mbOptions.html(multiBandwidthHTML.be a part of(“”)); var mbAnchors = mbOptions.kids(“a”); for (i = 0; i

Leave a Reply

Your email address will not be published. Required fields are marked *