videojs_rails 4.7.3 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09a5e75ed8e1da2d3d12fd85c362106954162a22
4
- data.tar.gz: bf7f11deb27980d5d8452d271b24f9d6c5e13acd
3
+ metadata.gz: a9a944d9c447a02ea7dd820a1446634ff0f53daa
4
+ data.tar.gz: fd150d325d6c2c291263aba8b5138ff399bfb662
5
5
  SHA512:
6
- metadata.gz: e326f904d321901affbfa826f74705fe79472247ce52b1c157b2966d047b733a73fba7826d5dfeee08061dfe114ff6697d79d54f0ac53b60e2dace34f9b84cee
7
- data.tar.gz: 8addec410307b8cc7c56c0cb884ad8cd9bfa1cc628054d16ae359a81c7856a5dac88257d7251d9a26fd3ee5905f638e63724525962d02d0dd012e77a6170739f
6
+ metadata.gz: 4975f12559b603e3ad94e71930936b3c43cca50d0944b7ab3cfed2e561f435edfbd1cec1bc3eb09b8033e492a20303732788cbe8c893b242372af8f4e12ff958
7
+ data.tar.gz: 12cf971774311ecec134944865531c0754f840864bab4ccc05779647f168bbc50bff25108fa9cb75afff6b0c28e27e7be21a1d86de1c96f02777ece82138378a
@@ -1,3 +1,3 @@
1
1
  module VideojsRails
2
- VERSION = '4.7.3'
2
+ VERSION = '4.8.0'
3
3
  end
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.7';
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.7 string
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, 'keyup', vjs.bind(this, this.onKeyPress));
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, 'keyup', vjs.bind(this, this.onKeyPress));
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
- this.error({ code: 4, message: this.localize(this.options()['notSupportedMessage']) });
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
- // In X seconds, if no more activity has occurred the user will be
4771
- // considered inactive
4772
- inactivityTimeout = setTimeout(vjs.bind(this, function() {
4773
- // Protect against the case where the inactivityTimeout can trigger just
4774
- // before the next user activity is picked up by the activityCheck loop
4775
- // causing a flicker
4776
- if (!this.userActivity_) {
4777
- this.userActive(false);
4778
- }
4779
- }), 2000);
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.features && this.tech.features['playbackRate']) {
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.features && player.tech.features['volumeControl'] === false) {
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.features && player.tech.features['volumeControl'] === false) {
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.features && player.tech.features['volumeControl'] === false) {
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.features && player.tech.features['volumeControl'] === false) {
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.features && player.tech.features.volumeControl === false) {
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.features && player.tech.features.volumeControl === false) {
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.features['playbackRate']
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.features['progressEvents']) {
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.features['timeupdateEvents']) {
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.features['timeupdateEvents'] = true;
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.features = {
6149
- 'volumeControl': true,
6171
+ vjs.MediaTechController.prototype['featuresVolumeControl'] = true;
6150
6172
 
6151
- // Resizing plugins using request fullscreen reloads the plugin
6152
- 'fullscreenResize': false,
6153
- 'playbackRate': false,
6173
+ // Resizing plugins using request fullscreen reloads the plugin
6174
+ vjs.MediaTechController.prototype['featuresFullscreenResize'] = false;
6175
+ vjs.MediaTechController.prototype['featuresPlaybackRate'] = false;
6154
6176
 
6155
- // Optional events that we can manually mimic with timers
6156
- // currently not triggered by video-js-swf
6157
- 'progressEvents': false,
6158
- 'timeupdateEvents': false
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.features['volumeControl'] = vjs.Html5.canControlVolume();
6198
+ this['featuresVolumeControl'] = vjs.Html5.canControlVolume();
6178
6199
 
6179
6200
  // just in case; or is it excessively...
6180
- this.features['playbackRate'] = vjs.Html5.canControlPlaybackRate();
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.features['movingMediaElementInDOM'] = !vjs.IS_IOS;
6204
+ this['movingMediaElementInDOM'] = !vjs.IS_IOS;
6184
6205
 
6185
6206
  // HTML video is able to automatically resize when going to fullscreen
6186
- this.features['fullscreenResize'] = true;
6207
+ this['featuresFullscreenResize'] = true;
6187
6208
 
6188
6209
  // HTML video supports progress events
6189
- this.features['progressEvents'] = true;
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.features['movingMediaElementInDOM'] === false) {
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){ this.el_.src = 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
 
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  Video.js Default Styles (http://videojs.com)
3
- Version 4.7.3
3
+ Version 4.8.0
4
4
  Create your own skin at http://designer.videojs.com
5
5
  */
6
6
  /* SKIN
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: videojs_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.3
4
+ version: 4.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Behan