videojs_rails 4.7.3 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9a944d9c447a02ea7dd820a1446634ff0f53daa
|
4
|
+
data.tar.gz: fd150d325d6c2c291263aba8b5138ff399bfb662
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4975f12559b603e3ad94e71930936b3c43cca50d0944b7ab3cfed2e561f435edfbd1cec1bc3eb09b8033e492a20303732788cbe8c893b242372af8f4e12ff958
|
7
|
+
data.tar.gz: 12cf971774311ecec134944865531c0754f840864bab4ccc05779647f168bbc50bff25108fa9cb75afff6b0c28e27e7be21a1d86de1c96f02777ece82138378a
|
Binary file
|
@@ -63,7 +63,7 @@ var vjs = function(id, options, ready){
|
|
63
63
|
var videojs = window['videojs'] = vjs;
|
64
64
|
|
65
65
|
// CDN Version. Used to target right flash swf.
|
66
|
-
vjs.CDN_VERSION = '4.
|
66
|
+
vjs.CDN_VERSION = '4.8';
|
67
67
|
vjs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://');
|
68
68
|
|
69
69
|
/**
|
@@ -92,6 +92,9 @@ vjs.options = {
|
|
92
92
|
// Add playback rate selection by adding rates
|
93
93
|
// 'playbackRates': [0.5, 1, 1.5, 2],
|
94
94
|
|
95
|
+
// default inactivity timeout
|
96
|
+
'inactivityTimeout': 2000,
|
97
|
+
|
95
98
|
// Included control sets
|
96
99
|
'children': {
|
97
100
|
'mediaLoader': {},
|
@@ -113,7 +116,7 @@ vjs.options = {
|
|
113
116
|
};
|
114
117
|
|
115
118
|
// Set CDN Version of swf
|
116
|
-
// The added (+) blocks the replace from changing this 4.
|
119
|
+
// The added (+) blocks the replace from changing this 4.8 string
|
117
120
|
if (vjs.CDN_VERSION !== 'GENERATED'+'_CDN_VSN') {
|
118
121
|
videojs.options['flash']['swf'] = "<%= asset_path('video-js.swf') %>";
|
119
122
|
}
|
@@ -836,6 +839,17 @@ vjs.obj.isArray = Array.isArray || function(arr) {
|
|
836
839
|
return Object.prototype.toString.call(arr) === '[object Array]';
|
837
840
|
};
|
838
841
|
|
842
|
+
/**
|
843
|
+
* Check to see whether the input is NaN or not.
|
844
|
+
* NaN is the only JavaScript construct that isn't equal to itself
|
845
|
+
* @param {Number} num Number to check
|
846
|
+
* @return {Boolean} True if NaN, false otherwise
|
847
|
+
* @private
|
848
|
+
*/
|
849
|
+
vjs.isNaN = function(num) {
|
850
|
+
return num !== num;
|
851
|
+
};
|
852
|
+
|
839
853
|
/**
|
840
854
|
* Bind (a.k.a proxy or Context). A simple method for changing the context of a function
|
841
855
|
It also stores a unique id on the function so it can be easily removed from events
|
@@ -2396,6 +2410,9 @@ vjs.Component.prototype.dimensions = function(width, height){
|
|
2396
2410
|
*/
|
2397
2411
|
vjs.Component.prototype.dimension = function(widthOrHeight, num, skipListeners){
|
2398
2412
|
if (num !== undefined) {
|
2413
|
+
if (num === null || vjs.isNaN(num)) {
|
2414
|
+
num = 0;
|
2415
|
+
}
|
2399
2416
|
|
2400
2417
|
// Check if using css width/height (% or px) and adjust
|
2401
2418
|
if ((''+num).indexOf('%') !== -1 || (''+num).indexOf('px') !== -1) {
|
@@ -2644,7 +2661,7 @@ vjs.Button.prototype.onClick = function(){};
|
|
2644
2661
|
|
2645
2662
|
// Focus - Add keyboard functionality to element
|
2646
2663
|
vjs.Button.prototype.onFocus = function(){
|
2647
|
-
vjs.on(document, '
|
2664
|
+
vjs.on(document, 'keydown', vjs.bind(this, this.onKeyPress));
|
2648
2665
|
};
|
2649
2666
|
|
2650
2667
|
// KeyPress (document level) - Trigger click when keys are pressed
|
@@ -2658,7 +2675,7 @@ vjs.Button.prototype.onKeyPress = function(event){
|
|
2658
2675
|
|
2659
2676
|
// Blur - Remove keyboard triggers
|
2660
2677
|
vjs.Button.prototype.onBlur = function(){
|
2661
|
-
vjs.off(document, '
|
2678
|
+
vjs.off(document, 'keydown', vjs.bind(this, this.onKeyPress));
|
2662
2679
|
};
|
2663
2680
|
/* Slider
|
2664
2681
|
================================================================================ */
|
@@ -3614,7 +3631,6 @@ vjs.Player.prototype.unloadTech = function(){
|
|
3614
3631
|
// vjs.log('loadedTech')
|
3615
3632
|
// },
|
3616
3633
|
|
3617
|
-
|
3618
3634
|
// /* Player event handlers (how the player reacts to certain events)
|
3619
3635
|
// ================================================================================ */
|
3620
3636
|
|
@@ -4432,7 +4448,11 @@ vjs.Player.prototype.sourceList_ = function(sources){
|
|
4432
4448
|
this.loadTech(sourceTech.tech, sourceTech.source);
|
4433
4449
|
}
|
4434
4450
|
} else {
|
4435
|
-
|
4451
|
+
// We need to wrap this in a timeout to give folks a chance to add error event handlers
|
4452
|
+
setTimeout(vjs.bind(this, function() {
|
4453
|
+
this.error({ code: 4, message: this.localize(this.options()['notSupportedMessage']) });
|
4454
|
+
}), 0);
|
4455
|
+
|
4436
4456
|
// we could not find an appropriate tech, but let's still notify the delegate that this is it
|
4437
4457
|
// this needs a better comment about why this is needed
|
4438
4458
|
this.triggerReady();
|
@@ -4767,16 +4787,19 @@ vjs.Player.prototype.listenForUserActivity = function(){
|
|
4767
4787
|
// Clear any existing inactivity timeout to start the timer over
|
4768
4788
|
clearTimeout(inactivityTimeout);
|
4769
4789
|
|
4770
|
-
|
4771
|
-
|
4772
|
-
|
4773
|
-
|
4774
|
-
|
4775
|
-
|
4776
|
-
|
4777
|
-
|
4778
|
-
|
4779
|
-
|
4790
|
+
var timeout = this.options()['inactivityTimeout'];
|
4791
|
+
if (timeout > 0) {
|
4792
|
+
// In <timeout> milliseconds, if no more activity has occurred the
|
4793
|
+
// user will be considered inactive
|
4794
|
+
inactivityTimeout = setTimeout(vjs.bind(this, function () {
|
4795
|
+
// Protect against the case where the inactivityTimeout can trigger just
|
4796
|
+
// before the next user activity is picked up by the activityCheck loop
|
4797
|
+
// causing a flicker
|
4798
|
+
if (!this.userActivity_) {
|
4799
|
+
this.userActive(false);
|
4800
|
+
}
|
4801
|
+
}), timeout);
|
4802
|
+
}
|
4780
4803
|
}
|
4781
4804
|
}), 250);
|
4782
4805
|
|
@@ -4793,7 +4816,7 @@ vjs.Player.prototype.playbackRate = function(rate) {
|
|
4793
4816
|
return this;
|
4794
4817
|
}
|
4795
4818
|
|
4796
|
-
if (this.tech && this.tech
|
4819
|
+
if (this.tech && this.tech['featuresPlaybackRate']) {
|
4797
4820
|
return this.techGet('playbackRate');
|
4798
4821
|
} else {
|
4799
4822
|
return 1.0;
|
@@ -5335,11 +5358,11 @@ vjs.VolumeControl = vjs.Component.extend({
|
|
5335
5358
|
vjs.Component.call(this, player, options);
|
5336
5359
|
|
5337
5360
|
// hide volume controls when they're not supported by the current tech
|
5338
|
-
if (player.tech && player.tech
|
5361
|
+
if (player.tech && player.tech['featuresVolumeControl'] === false) {
|
5339
5362
|
this.addClass('vjs-hidden');
|
5340
5363
|
}
|
5341
5364
|
player.on('loadstart', vjs.bind(this, function(){
|
5342
|
-
if (player.tech
|
5365
|
+
if (player.tech['featuresVolumeControl'] === false) {
|
5343
5366
|
this.addClass('vjs-hidden');
|
5344
5367
|
} else {
|
5345
5368
|
this.removeClass('vjs-hidden');
|
@@ -5477,11 +5500,11 @@ vjs.MuteToggle = vjs.Button.extend({
|
|
5477
5500
|
player.on('volumechange', vjs.bind(this, this.update));
|
5478
5501
|
|
5479
5502
|
// hide mute toggle if the current tech doesn't support volume control
|
5480
|
-
if (player.tech && player.tech
|
5503
|
+
if (player.tech && player.tech['featuresVolumeControl'] === false) {
|
5481
5504
|
this.addClass('vjs-hidden');
|
5482
5505
|
}
|
5483
5506
|
player.on('loadstart', vjs.bind(this, function(){
|
5484
|
-
if (player.tech
|
5507
|
+
if (player.tech['featuresVolumeControl'] === false) {
|
5485
5508
|
this.addClass('vjs-hidden');
|
5486
5509
|
} else {
|
5487
5510
|
this.removeClass('vjs-hidden');
|
@@ -5545,11 +5568,11 @@ vjs.VolumeMenuButton = vjs.MenuButton.extend({
|
|
5545
5568
|
player.on('volumechange', vjs.bind(this, this.update));
|
5546
5569
|
|
5547
5570
|
// hide mute toggle if the current tech doesn't support volume control
|
5548
|
-
if (player.tech && player.tech
|
5571
|
+
if (player.tech && player.tech['featuresVolumeControl'] === false) {
|
5549
5572
|
this.addClass('vjs-hidden');
|
5550
5573
|
}
|
5551
5574
|
player.on('loadstart', vjs.bind(this, function(){
|
5552
|
-
if (player.tech
|
5575
|
+
if (player.tech['featuresVolumeControl'] === false) {
|
5553
5576
|
this.addClass('vjs-hidden');
|
5554
5577
|
} else {
|
5555
5578
|
this.removeClass('vjs-hidden');
|
@@ -5654,7 +5677,7 @@ vjs.PlaybackRateMenuButton.prototype.onClick = function(){
|
|
5654
5677
|
|
5655
5678
|
vjs.PlaybackRateMenuButton.prototype.playbackRateSupported = function(){
|
5656
5679
|
return this.player().tech
|
5657
|
-
&& this.player().tech
|
5680
|
+
&& this.player().tech['featuresPlaybackRate']
|
5658
5681
|
&& this.player().options()['playbackRates']
|
5659
5682
|
&& this.player().options()['playbackRates'].length > 0
|
5660
5683
|
;
|
@@ -5903,12 +5926,12 @@ vjs.MediaTechController = vjs.Component.extend({
|
|
5903
5926
|
vjs.Component.call(this, player, options, ready);
|
5904
5927
|
|
5905
5928
|
// Manually track progress in cases where the browser/flash player doesn't report it.
|
5906
|
-
if (!this
|
5929
|
+
if (!this['featuresProgressEvents']) {
|
5907
5930
|
this.manualProgressOn();
|
5908
5931
|
}
|
5909
5932
|
|
5910
5933
|
// Manually track timeudpates in cases where the browser/flash player doesn't report it.
|
5911
|
-
if (!this
|
5934
|
+
if (!this['featuresTimeupdateEvents']) {
|
5912
5935
|
this.manualTimeUpdatesOn();
|
5913
5936
|
}
|
5914
5937
|
|
@@ -6094,7 +6117,7 @@ vjs.MediaTechController.prototype.manualTimeUpdatesOn = function(){
|
|
6094
6117
|
// Watch for native timeupdate event
|
6095
6118
|
this.one('timeupdate', function(){
|
6096
6119
|
// Update known progress support for this playback technology
|
6097
|
-
this
|
6120
|
+
this['featuresTimeupdateEvents'] = true;
|
6098
6121
|
// Turn off manual progress tracking
|
6099
6122
|
this.manualTimeUpdatesOff();
|
6100
6123
|
});
|
@@ -6145,18 +6168,16 @@ vjs.MediaTechController.prototype.setCurrentTime = function() {
|
|
6145
6168
|
*/
|
6146
6169
|
vjs.MediaTechController.prototype.setPoster = function(){};
|
6147
6170
|
|
6148
|
-
vjs.MediaTechController.prototype
|
6149
|
-
'volumeControl': true,
|
6171
|
+
vjs.MediaTechController.prototype['featuresVolumeControl'] = true;
|
6150
6172
|
|
6151
|
-
|
6152
|
-
|
6153
|
-
|
6173
|
+
// Resizing plugins using request fullscreen reloads the plugin
|
6174
|
+
vjs.MediaTechController.prototype['featuresFullscreenResize'] = false;
|
6175
|
+
vjs.MediaTechController.prototype['featuresPlaybackRate'] = false;
|
6154
6176
|
|
6155
|
-
|
6156
|
-
|
6157
|
-
|
6158
|
-
|
6159
|
-
};
|
6177
|
+
// Optional events that we can manually mimic with timers
|
6178
|
+
// currently not triggered by video-js-swf
|
6179
|
+
vjs.MediaTechController.prototype['featuresProgressEvents'] = false;
|
6180
|
+
vjs.MediaTechController.prototype['featuresTimeupdateEvents'] = false;
|
6160
6181
|
|
6161
6182
|
vjs.media = {};
|
6162
6183
|
/**
|
@@ -6174,19 +6195,19 @@ vjs.Html5 = vjs.MediaTechController.extend({
|
|
6174
6195
|
/** @constructor */
|
6175
6196
|
init: function(player, options, ready){
|
6176
6197
|
// volume cannot be changed from 1 on iOS
|
6177
|
-
this
|
6198
|
+
this['featuresVolumeControl'] = vjs.Html5.canControlVolume();
|
6178
6199
|
|
6179
6200
|
// just in case; or is it excessively...
|
6180
|
-
this
|
6201
|
+
this['featuresPlaybackRate'] = vjs.Html5.canControlPlaybackRate();
|
6181
6202
|
|
6182
6203
|
// In iOS, if you move a video element in the DOM, it breaks video playback.
|
6183
|
-
this
|
6204
|
+
this['movingMediaElementInDOM'] = !vjs.IS_IOS;
|
6184
6205
|
|
6185
6206
|
// HTML video is able to automatically resize when going to fullscreen
|
6186
|
-
this
|
6207
|
+
this['featuresFullscreenResize'] = true;
|
6187
6208
|
|
6188
6209
|
// HTML video supports progress events
|
6189
|
-
this
|
6210
|
+
this['featuresProgressEvents'] = true;
|
6190
6211
|
|
6191
6212
|
vjs.MediaTechController.call(this, player, options, ready);
|
6192
6213
|
this.setupTriggers();
|
@@ -6236,7 +6257,7 @@ vjs.Html5.prototype.createEl = function(){
|
|
6236
6257
|
// Check if this browser supports moving the element into the box.
|
6237
6258
|
// On the iPhone video will break if you move the element,
|
6238
6259
|
// So we have to create a brand new element.
|
6239
|
-
if (!el || this
|
6260
|
+
if (!el || this['movingMediaElementInDOM'] === false) {
|
6240
6261
|
|
6241
6262
|
// If the original tag is still there, clone and remove it.
|
6242
6263
|
if (el) {
|
@@ -6386,7 +6407,13 @@ vjs.Html5.prototype.enterFullScreen = function(){
|
|
6386
6407
|
vjs.Html5.prototype.exitFullScreen = function(){
|
6387
6408
|
this.el_.webkitExitFullScreen();
|
6388
6409
|
};
|
6389
|
-
vjs.Html5.prototype.src = function(src){
|
6410
|
+
vjs.Html5.prototype.src = function(src) {
|
6411
|
+
if (src === undefined) {
|
6412
|
+
return this.el_.src;
|
6413
|
+
} else {
|
6414
|
+
this.el_.src = src;
|
6415
|
+
}
|
6416
|
+
};
|
6390
6417
|
vjs.Html5.prototype.load = function(){ this.el_.load(); };
|
6391
6418
|
vjs.Html5.prototype.currentSrc = function(){ return this.el_.currentSrc; };
|
6392
6419
|
|