@wbx/view-plyr
Advanced tools
Comparing version 3.5.6 to 3.5.10-a
{ | ||
"name": "@wbx/view-plyr", | ||
"version": "3.5.6", | ||
"version": "3.5.10-a", | ||
"description": "Plyr player as Webix view", | ||
@@ -5,0 +5,0 @@ "main": "plyr.js", |
37
plyr.js
webix.protoUI({ | ||
name:"plyr-player", | ||
defaults:{ | ||
config:{}, | ||
name:"plyr-player", | ||
defaults:{ | ||
config:{}, | ||
source:{} | ||
}, | ||
$init:function(){ | ||
this.$view.innerHTML = '<div class="webix_video_parent"><video playsinline controls></video></div>'; | ||
}, | ||
$init:function(){ | ||
this.$view.innerHTML = '<div class="webix_player_parent"><audio></audio></div>'; | ||
this._container = this.$view.firstChild.firstChild; | ||
// visibility of tooltips and popup menu | ||
this.$view.style.overflow = "visible"; | ||
this._waitView = webix.promise.defer(); | ||
@@ -23,3 +25,3 @@ this.$ready.push(this.render); | ||
var cdn = this.config.cdn ? this.config.cdn : "https://cdn.plyr.io/3.5.6"; | ||
var cdn = this.config.cdn ? this.config.cdn : "https://cdn.plyr.io/3.5.10"; | ||
@@ -36,17 +38,22 @@ webix.require([ | ||
}, | ||
_initPlyr:function(){ | ||
_initPlyr:function(){ | ||
var options = webix.extend({}, this.config.config); | ||
this._player = new Plyr(this._container, options); | ||
this._player.elements.container.setAttribute("tabindex", "-1"); | ||
this._waitView.resolve(this._player); | ||
this._player.on("canplay", webix.bind(function(){ | ||
// prevent focusing on media tag outside the expected UI | ||
this._player.media.setAttribute("tabindex", "-1"); | ||
this._normalizeRatio(); | ||
}, this)); | ||
this._player.on("ready", webix.bind(function(){ | ||
// allow width less than 200px | ||
this.$view.querySelector(".plyr--full-ui").style["min-width"] = "0px"; | ||
this._normalizeRatio(); | ||
}, this)); | ||
}, | ||
}, | ||
$setSize:function(x,y){ | ||
this.$view.firstChild.style.width = x+"px"; | ||
this.$view.firstChild.style.height = y+"px"; | ||
this.$view.firstChild.style.height = (y-2)+"px"; | ||
if (this._player) | ||
@@ -75,7 +82,7 @@ this._normalizeRatio(x, y); | ||
_normalizeRatio:function(x, y){ | ||
var x = x || this.$view.clientWidth, | ||
y = y || this.$view.clientHeight; | ||
x = x || this.$view.clientWidth; | ||
y = y || this.$view.clientHeight; | ||
var div = this._gcdRatio(x, y), | ||
ratioX = (x/div).toString(), | ||
ratioY = (y/div).toString(); | ||
ratioY = (y/div).toString(), | ||
ratio = ratioX+":"+ratioY; | ||
@@ -82,0 +89,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4949
82
2