mirror of
https://github.com/videojs/video.js.git
synced 2025-01-31 11:26:45 +02:00
Merge branch 'feature/better-element-load'
This commit is contained in:
commit
ec07398114
@ -1,3 +1,4 @@
|
|||||||
|
* Improved load order of elements to reduce reflow.
|
||||||
* Changed addEvent function name to 'on'.
|
* Changed addEvent function name to 'on'.
|
||||||
* Removed conflicting array.indexOf function
|
* Removed conflicting array.indexOf function
|
||||||
* Added exitFullScreen to support BlackBerry devices (pull/143)
|
* Added exitFullScreen to support BlackBerry devices (pull/143)
|
||||||
|
@ -26,19 +26,14 @@ _V_.Player = _V_.Component.extend({
|
|||||||
// Make player findable on elements
|
// Make player findable on elements
|
||||||
tag.player = el.player = this;
|
tag.player = el.player = this;
|
||||||
|
|
||||||
// Wrap video tag in div (el/box) container
|
// Make sure tag ID exists
|
||||||
tag.parentNode.insertBefore(el, tag);
|
tag.id = tag.id || "vjs_video_" + _V_.guid++;
|
||||||
el.appendChild(tag); // Breaks iPhone, fixed in HTML5 setup.
|
|
||||||
|
|
||||||
// Give video tag properties to box
|
// Give video tag properties to box
|
||||||
// ID will now reference box, not the video tag
|
// ID will now reference box, not the video tag
|
||||||
this.id = el.id = tag.id;
|
this.id = el.id = tag.id;
|
||||||
el.className = tag.className;
|
el.className = tag.className;
|
||||||
|
|
||||||
// Update tag id/class for use as HTML5 playback tech
|
|
||||||
tag.id += "_html5_api";
|
|
||||||
tag.className = "vjs-tech";
|
|
||||||
|
|
||||||
// Make player easily findable by ID
|
// Make player easily findable by ID
|
||||||
_V_.players[el.id] = this;
|
_V_.players[el.id] = this;
|
||||||
|
|
||||||
@ -50,10 +45,20 @@ _V_.Player = _V_.Component.extend({
|
|||||||
el.style.width = options.width+"px";
|
el.style.width = options.width+"px";
|
||||||
el.style.height = options.height+"px";
|
el.style.height = options.height+"px";
|
||||||
|
|
||||||
|
// Update tag id/class for use as HTML5 playback tech
|
||||||
|
// Might think we should do this after embedding in container so .vjs-tech class
|
||||||
|
// doesn't flash 100% width/height, but class only applies with .video-js parent
|
||||||
|
tag.id += "_html5_api";
|
||||||
|
tag.className = "vjs-tech";
|
||||||
|
|
||||||
// Remove width/height attrs from tag so CSS can make it 100% width/height
|
// Remove width/height attrs from tag so CSS can make it 100% width/height
|
||||||
tag.removeAttribute("width");
|
tag.removeAttribute("width");
|
||||||
tag.removeAttribute("height");
|
tag.removeAttribute("height");
|
||||||
|
|
||||||
|
// Wrap video tag in div (el/box) container
|
||||||
|
tag.parentNode.insertBefore(el, tag);
|
||||||
|
el.appendChild(tag); // Breaks iPhone, fixed in HTML5 setup.
|
||||||
|
|
||||||
// Empty video tag sources and tracks so the built-in player doesn't use them also.
|
// Empty video tag sources and tracks so the built-in player doesn't use them also.
|
||||||
if (tag.hasChildNodes()) {
|
if (tag.hasChildNodes()) {
|
||||||
var nrOfChildNodes = tag.childNodes.length;
|
var nrOfChildNodes = tag.childNodes.length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user