Lecteur vidéo
Présentation
Gestion d'un lecteur vidéo simple.
?
?
Pour VideoTrack et AudioTrack : activer Experimental Web Platform features pour Chrome, Opera, Edge ou media.track.enabled pour Firefox. Test ci-dessous avec la vidéo en/fr - VP9 480P (78M).
?
Code HTML
html<div style="height:447px;">
<video preload="metadata" poster=".../poster.jpg" data-src=".../playlist.m3u8" class="apijsplayer"></video>
</div>
Informations complémentaires
?
?
API
jsapijs.i18n.translate("word"); // return string
apijs.i18n.translateNode("word"); // return domelement
apijs.i18n.changeLang("fr"); // return boolean
apijs.dialog.dialogInformation(...); // return boolean
apijs.dialog.dialogConfirmation(...); // return boolean
apijs.dialog.dialogFormOptions(...); // return boolean
apijs.dialog.dialogFormUpload(...); // return boolean
apijs.dialog.dialogProgress(...); // return boolean
apijs.dialog.dialogWaiting(...); // return boolean
apijs.dialog.dialogPhoto(...); // return boolean
apijs.dialog.dialogVideo(...); // return boolean
apijs.dialog.dialogIframe(...); // return boolean
apijs.dialog.dialogAjax(...); // return boolean
apijs.dialog.actionClose(); // return void
apijs.dialog.add("string1", "string2"); // return dialog object
apijs.dialog.remove("string1", "string2"); // return dialog object
apijs.dialog.toggle("string1", "string2"); // return dialog object
apijs.dialog.has("string1", "string2"); // return boolean (true if one found)
apijs.upload.sendFile(...); // return boolean
apijs.upload.sendFiles(...); // return boolean
apijs.slideshow.show("slideshow.2.1"); // return boolean
apijs.slideshow.actionFirst(); // return boolean
apijs.slideshow.actionPrev(); // return boolean
apijs.slideshow.actionNext(); // return boolean
apijs.slideshow.actionLast(); // return boolean
// default config //////////////////////////////////////////
apijs.config.lang = "auto";
apijs.config.debug = false;
apijs.config.dialog.closeOnClick = false;
apijs.config.dialog.restrictNavigation = true;
apijs.config.dialog.player = true; // true|false|userFunction(videoTag, url)
apijs.config.slideshow.ids = "slideshow";
apijs.config.slideshow.anchor = true;
apijs.config.upload.tokenName = "X-CSRF-Token";
apijs.config.upload.tokenValue = null;
// events //////////////////////////////////////////////////
self.addEventListener("apijsbeforeload", function () {
apijs.dialog.htmlContentOrig = apijs.dialog.htmlContent;
apijs.dialog.htmlContent = function (title, text) {
alert(title);
this.htmlContentOrig(title, text);
};
if (!apijs.i18n.data.hasOwnProperty("xy")) apijs.i18n.data.xy = {};
apijs.i18n.data.xy["xyz"] = "Test";
apijs.config.debug = true;
});
self.addEventListener("apijsload", function () {
console.log("ready");
});
self.addEventListener("apijsajaxresponse", function (ev) {
console.log(ev.detail);
});