Comparar commits

..

12 Commits

Autor SHA1 Mensagem Data
Gary 3e296c9403 v5.2.3 dist 2015-11-24 20:52:35 +00:00
Gary 3e19c91828 v5.2.3 2015-11-24 20:52:01 +00:00
Gary Katsevman 5f9095079e @gkatsev fixed clearing out errors. closes #2850 2015-11-24 15:37:34 -05:00
paladox 552d8cbda3 v5.2.2 2015-11-23 17:31:27 +00:00
paladox 8d0de0fa51 @paladox updated xhr from deprecated ver to v2.2. closes #2837 2015-11-23 12:22:07 -05:00
tomaspinho c4dbd2488b @tomaspinho added 'ended' event to API docs. closes #2836 2015-11-23 12:15:50 -05:00
Violeta Marculescu c0d5f471bc @bcvio fixed returning current source rather than blob url. closes #2833 2015-11-23 12:04:31 -05:00
Nathaniel Bibler 3a40b10fa6 @nbibler ensured classes begin with alpha characters. Fixes #2828. closes #2829 2015-11-20 17:38:05 -05:00
Dat Tran 7dff83b2a4 @DatTran fixed bower paths. Fixes #2740. closes #2775 2015-11-20 17:22:49 -05:00
Kay 6bbd6f1a65 v5.2.1 2015-11-16 16:43:29 +00:00
Kay J d9b5fbc60d @ksjun corrected the registerTech export. closes #2816 2015-11-16 10:42:35 -05:00
David LaPalomento 385266338a @dmlap Check a component is a function before new-ing. closes #2814 2015-11-16 10:18:09 -05:00
18 arquivos alterados com 540 adições e 455 exclusões
+14
Ver Arquivo
@@ -6,6 +6,20 @@ _(none)_
--------------------
## 5.2.3 (2015-11-24)
* @gkatsev fixed clearing out errors ([view](https://github.com/videojs/video.js/pull/2850))
## 5.2.2 (2015-11-23)
* @DatTran fixed bower paths. Fixes #2740 ([view](https://github.com/videojs/video.js/pull/2775))
* @nbibler ensured classes begin with alpha characters. Fixes #2828 ([view](https://github.com/videojs/video.js/pull/2829))
* @bcvio fixed returning current source rather than blob url ([view](https://github.com/videojs/video.js/pull/2833))
* @tomaspinho added ended event to API docs ([view](https://github.com/videojs/video.js/pull/2836))
* @paladox updated xhr from deprecated ver to v2.2 ([view](https://github.com/videojs/video.js/pull/2837))
## 5.2.1 (2015-11-16)
* @dmlap Check a component is a function before new-ing ([view](https://github.com/videojs/video.js/pull/2814))
* @ksjun corrected the registerTech export ([view](https://github.com/videojs/video.js/pull/2816))
## 5.2.0 (2015-11-10)
* @gkatsev made initListeners more general and added Tech.isTech. Fixes #2767 ([view](https://github.com/videojs/video.js/pull/2773))
* @dmlap updated swf to 5.0.1 ([view](https://github.com/videojs/video.js/pull/2795))
+2 -2
Ver Arquivo
@@ -2,8 +2,8 @@
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"main": [
"src/js/video.js",
"src/css/video-js.scss"
"dist/video.js",
"dist/video-js.css"
],
"moduleType": "es6",
"keywords": [
+1 -1
Ver Arquivo
@@ -1,7 +1,7 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "5.2.0",
"version": "5.2.3",
"keywords": [
"videojs",
"html5",
+207 -172
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+9 -8
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
Arquivo binário não exibido.
+207 -172
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+14 -12
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
+9 -8
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
+1 -1
Ver Arquivo
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "5.2.0",
"version": "5.2.3",
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
"license": "Apache-2.0",
"keywords": [
@@ -32,7 +32,7 @@
"videojs-ie8": "1.1.0",
"videojs-swf": "5.0.1",
"vtt.js": "git+https://github.com/gkatsev/vtt.js.git#vjs-v0.12.1",
"xhr": "2.1.0"
"xhr": "~2.2.0"
},
"devDependencies": {
"babel": "^5.2.2",
+8
Ver Arquivo
@@ -373,6 +373,14 @@ class Component {
throw new Error(`Component ${componentClassName} does not exist`);
}
// data stored directly on the videojs object may be
// misidentified as a component to retain
// backwards-compatibility with 4.x. check to make sure the
// component class can be instantiated.
if (typeof ComponentClass !== 'function') {
return null;
}
component = new ComponentClass(this.player_ || this, options);
// child is a component instance
+18 -4
Ver Arquivo
@@ -415,6 +415,7 @@ class Player extends Component {
let width;
let height;
let aspectRatio;
let idClass;
// The aspect ratio is either used directly or to calculate width and height.
if (this.aspectRatio_ !== undefined && this.aspectRatio_ !== 'auto') {
@@ -451,7 +452,12 @@ class Player extends Component {
height = width * ratioMultiplier;
}
let idClass = this.id()+'-dimensions';
// Ensure the CSS class is valid by starting with an alpha character
if (/^[^a-zA-Z]/.test(this.id())) {
idClass = 'dimensions-'+this.id();
} else {
idClass = this.id()+'-dimensions';
}
// Ensure the right class is still on the player for the style element
this.addClass(idClass);
@@ -2101,6 +2107,7 @@ class Player extends Component {
if (err === null) {
this.error_ = err;
this.removeClass('vjs-error');
this.errorDisplay.close();
return this;
}
@@ -2111,9 +2118,6 @@ class Player extends Component {
this.error_ = new MediaError(err);
}
// fire an error event on the player
this.trigger('error');
// add the vjs-error classname to the player
this.addClass('vjs-error');
@@ -2121,6 +2125,9 @@ class Player extends Component {
// ie8 just logs "[object object]" if you just log the error object
log.error(`(CODE:${this.error_.code} ${MediaError.errorTypes[this.error_.code]})`, this.error_.message, this.error_);
// fire an error event on the player
this.trigger('error');
return this;
}
@@ -2711,6 +2718,13 @@ Player.prototype.handleUserInactive_;
*/
Player.prototype.handleTimeUpdate_;
/**
* Fired when video playback ends
*
* @event ended
*/
Player.prototype.handleTechEnded_;
/**
* Fired when the volume changes
*
+7 -1
Ver Arquivo
@@ -492,7 +492,13 @@ class Html5 extends Tech {
* @return {Object}
* @method currentSrc
*/
currentSrc() { return this.el_.currentSrc; }
currentSrc() {
if (this.currentSource_) {
return this.currentSource_.src;
} else {
return this.el_.currentSrc;
}
}
/**
* Get poster
+1 -1
Ver Arquivo
@@ -246,7 +246,7 @@ videojs.getTech = Tech.getTech;
* @mixes videojs
* @method registerTech
*/
videojs.registerTech = Component.registerTech;
videojs.registerTech = Tech.registerTech;
/**
* A suite of browser and device tests
+33 -70
Ver Arquivo
@@ -17,36 +17,6 @@ q.module('Player', {
}
});
// Compiler doesn't like using 'this' in setup/teardown.
// module("Player", {
// /**
// * @this {*}
// */
// setup: function(){
// window.player1 = true; // using window works
// },
// /**
// * @this {*}
// */
// teardown: function(){
// // if (this.player && this.player.el() !== null) {
// // this.player.dispose();
// // this.player = null;
// // }
// }
// });
// Object.size = function(obj) {
// var size = 0, key;
// for (key in obj) {
// console.log('key', key)
// if (obj.hasOwnProperty(key)) size++;
// }
// return size;
// };
test('should create player instance that inherits from component and dispose it', function(){
var player = TestHelpers.makePlayer();
@@ -199,6 +169,21 @@ test('should set the width, height, and aspect ratio via a css class', function(
ok(confirmSetting('padding-top', '25%'), 'aspect ratio percent should match the newly set aspect ratio');
});
test('should use an class name that begins with an alpha character', function(){
let alphaPlayer = TestHelpers.makePlayer({ id: 'alpha1' });
let numericPlayer = TestHelpers.makePlayer({ id: '1numeric' });
let getStyleText = function(styleEl){
return (styleEl.styleSheet && styleEl.styleSheet.cssText) || styleEl.innerHTML;
};
alphaPlayer.width(100);
numericPlayer.width(100);
ok(/\s*\.alpha1-dimensions\s*\{/.test(getStyleText(alphaPlayer.styleEl_)), 'appends -dimensions to an alpha player ID');
ok(/\s*\.dimensions-1numeric\s*\{/.test(getStyleText(numericPlayer.styleEl_)), 'prepends dimensions- to a numeric player ID');
});
test('should wrap the original tag in the player div', function(){
var tag = TestHelpers.makeTag();
var container = document.createElement('div');
@@ -324,24 +309,6 @@ test('should set controls and trigger events', function() {
player.dispose();
});
// Can't figure out how to test fullscreen events with tests
// Browsers aren't triggering the events at least
// asyncTest('should trigger the fullscreenchange event', function() {
// expect(3);
// var player = TestHelpers.makePlayer();
// player.on('fullscreenchange', function(){
// ok(true, 'fullscreenchange event fired');
// ok(this.isFullscreen() === true, 'isFullscreen is true');
// ok(this.el().className.indexOf('vjs-fullscreen') !== -1, 'vjs-fullscreen class added');
// player.dispose();
// start();
// });
// player.requestFullscreen();
// });
test('should toggle user the user state between active and inactive', function(){
var player = TestHelpers.makePlayer({});
@@ -441,28 +408,6 @@ test('make sure that controls listeners do not get added too many times', functi
player.dispose();
});
// test('should use custom message when encountering an unsupported video type',
// function() {
// videojs.options['notSupportedMessage'] = 'Video no go <a href="">link</a>';
// var fixture = document.getElementById('qunit-fixture');
// var html =
// '<video id="example_1">' +
// '<source src="fake.foo" type="video/foo">' +
// '</video>';
// fixture.innerHTML += html;
// var tag = document.getElementById('example_1');
// var player = new Player(tag, { techOrder: ['techFaker'] });
// var incompatibilityMessage = player.el().getElementsByTagName('p')[0];
// // ie8 capitalizes tag names
// equal(incompatibilityMessage.innerHTML.toLowerCase(), 'video no go <a href="">link</a>');
// player.dispose();
// });
test('should register players with generated ids', function(){
var fixture, video, player, id;
fixture = document.getElementById('qunit-fixture');
@@ -859,3 +804,21 @@ test('createModal() options object', function() {
strictEqual(modal.options_.label, 'boo', 'modal options are set properly');
modal.close();
});
test('you can clear error in the error event', function() {
let player = TestHelpers.makePlayer();
sinon.stub(log, 'error');
player.error({code: 4});
ok(player.error(), 'we have an error');
player.error(null);
player.one('error', function() {
player.error(null);
});
player.error({code: 4});
ok(!player.error(), 'we no longer have an error');
log.error.restore();
});
+6
Ver Arquivo
@@ -249,6 +249,12 @@ if (Html5.supportsNativeTextTracks()) {
equal(adds[2][0], rems[2][0], 'removetrack event handler removed');
});
}
test('should always return currentSource_ if set', function(){
let currentSrc = Html5.prototype.currentSrc;
equal(currentSrc.call({el_: {currentSrc:'test1'}}), 'test1', 'sould return source from element if nothing else set');
equal(currentSrc.call({currentSource_:{src: 'test2'}}), 'test2', 'sould return source from currentSource_, if nothing else set');
equal(currentSrc.call({currentSource_:{src: 'test2'}, el_:{currentSrc:'test1'}}), 'test2', 'sould return source from source set, not from element');
});
test('should fire makeup events when a video tag is initialized late', function(){
let lateInit = Html5.prototype.handleLateInit_;