videojs_rails 4.4.3 → 4.5.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: b56e9349e37bb967f0f27b85f9efbcc32e34ed8a
4
- data.tar.gz: 1c51a53bf2d823dde50a3bd59f4e13412674ddb1
3
+ metadata.gz: d0c79cf1cfd41df21a53972951dad8f415ad313c
4
+ data.tar.gz: 33d1d37bfccca58268f1831eee295919b80a1a94
5
5
  SHA512:
6
- metadata.gz: 0d6496d86af06615ada5403fae163400a90f8b6257671652b65f11bf63c17433093965ab56fbefc770a982799124abdf828b16468449a7356848974e1e93ff5d
7
- data.tar.gz: b2b0d675a6192a8aebbb4ef380c646451696e4079d7d312cc9999e75fe57d5d05a9ac463a32fe6a5457de2570498b2435cdf625d2dcf22a7a6d5a1cd4e0ed80a
6
+ metadata.gz: 29dd80e60b1c7b11d0f57ae0977dea2056de59c5acaca74525cfcf47dd623396a4d37c12831ca6e0f78ddcf23862b2ed3b874c0f70ff2095ab2413f8e0b17216
7
+ data.tar.gz: 872ccdd4d98119efff93fc22917f5bfdb2df59b73d4c23866b9c797e193109992fb5975e5cd94326c6dfabb87ca529acdf7bd1277de25b589ff328bdd487a6ca
@@ -1,3 +1,3 @@
1
1
  module VideojsRails
2
- VERSION = "4.4.3"
2
+ VERSION = "4.5.0"
3
3
  end
@@ -64,7 +64,7 @@ var videojs = vjs;
64
64
  window.videojs = window.vjs = vjs;
65
65
 
66
66
  // CDN Version. Used to target right flash swf.
67
- vjs.CDN_VERSION = '4.4';
67
+ vjs.CDN_VERSION = '4.5';
68
68
  vjs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://');
69
69
 
70
70
  /**
@@ -106,7 +106,7 @@ vjs.options = {
106
106
  };
107
107
 
108
108
  // Set CDN Version of swf
109
- // The added (+) blocks the replace from changing this 4.4 string
109
+ // The added (+) blocks the replace from changing this 4.5 string
110
110
  if (vjs.CDN_VERSION !== 'GENERATED'+'_CDN_VSN') {
111
111
  videojs.options['flash']['swf'] = vjs.ACCESS_PROTOCOL + 'vjs.zencdn.net/'+vjs.CDN_VERSION+'/video-js.swf';
112
112
  }
@@ -468,9 +468,11 @@ vjs.fixEvent = function(event) {
468
468
  }
469
469
  event.returnValue = false;
470
470
  event.isDefaultPrevented = returnTrue;
471
+ event.defaultPrevented = true;
471
472
  };
472
473
 
473
474
  event.isDefaultPrevented = returnFalse;
475
+ event.defaultPrevented = false;
474
476
 
475
477
  // Stop the event from bubbling
476
478
  event.stopPropagation = function () {
@@ -555,7 +557,7 @@ vjs.trigger = function(elem, event) {
555
557
  vjs.trigger(parent, event);
556
558
 
557
559
  // If at the top of the DOM, triggers the default action unless disabled.
558
- } else if (!parent && !event.isDefaultPrevented()) {
560
+ } else if (!parent && !event.defaultPrevented) {
559
561
  var targetData = vjs.getData(event.target);
560
562
 
561
563
  // Checks if the target has a default action for this event.
@@ -572,7 +574,7 @@ vjs.trigger = function(elem, event) {
572
574
  }
573
575
 
574
576
  // Inform the triggerer if the default was prevented by returning false
575
- return !event.isDefaultPrevented();
577
+ return !event.defaultPrevented;
576
578
  /* Original version of js ninja events wasn't complete.
577
579
  * We've since updated to the latest version, but keeping this around
578
580
  * for now just in case.
@@ -1304,9 +1306,10 @@ vjs.findPosition = function(el) {
1304
1306
  scrollTop = window.pageYOffset || body.scrollTop;
1305
1307
  top = box.top + scrollTop - clientTop;
1306
1308
 
1309
+ // Android sometimes returns slightly off decimal values, so need to round
1307
1310
  return {
1308
- left: left,
1309
- top: top
1311
+ left: vjs.round(left),
1312
+ top: vjs.round(top)
1310
1313
  };
1311
1314
  };
1312
1315
  /**
@@ -3820,9 +3823,14 @@ vjs.Player.prototype.selectSource = function(sources){
3820
3823
  * ]);
3821
3824
  *
3822
3825
  * @param {String|Object|Array=} source The source URL, object, or array of sources
3823
- * @return {vjs.Player} self
3826
+ * @return {String} The current video source when getting
3827
+ * @return {String} The player when setting
3824
3828
  */
3825
3829
  vjs.Player.prototype.src = function(source){
3830
+ if (source === undefined) {
3831
+ return this.techGet('src');
3832
+ }
3833
+
3826
3834
  // Case: Array of source objects to choose from and pick the best to play
3827
3835
  if (source instanceof Array) {
3828
3836
 
@@ -3844,6 +3852,7 @@ vjs.Player.prototype.src = function(source){
3844
3852
  this.el_.appendChild(vjs.createEl('p', {
3845
3853
  innerHTML: this.options()['notSupportedMessage']
3846
3854
  }));
3855
+ this.triggerReady(); // we could not find an appropriate tech, but let's still notify the delegate that this is it
3847
3856
  }
3848
3857
 
3849
3858
  // Case: Source object { src: '', type: '' ... }
@@ -3875,6 +3884,7 @@ vjs.Player.prototype.src = function(source){
3875
3884
  }
3876
3885
  }
3877
3886
  }
3887
+
3878
3888
  return this;
3879
3889
  };
3880
3890
 
@@ -4074,10 +4084,13 @@ vjs.Player.prototype.userActive = function(bool){
4074
4084
  //
4075
4085
  // When this gets resolved in ALL browsers it can be removed
4076
4086
  // https://code.google.com/p/chromium/issues/detail?id=103041
4077
- this.tech.one('mousemove', function(e){
4078
- e.stopPropagation();
4079
- e.preventDefault();
4080
- });
4087
+ if(this.tech) {
4088
+ this.tech.one('mousemove', function(e){
4089
+ e.stopPropagation();
4090
+ e.preventDefault();
4091
+ });
4092
+ }
4093
+
4081
4094
  this.removeClass('vjs-user-active');
4082
4095
  this.addClass('vjs-user-inactive');
4083
4096
  this.trigger('userinactive');
@@ -5021,8 +5034,6 @@ vjs.LoadingSpinner = vjs.Component.extend({
5021
5034
  player.on('canplay', vjs.bind(this, this.hide));
5022
5035
  player.on('canplaythrough', vjs.bind(this, this.hide));
5023
5036
  player.on('playing', vjs.bind(this, this.hide));
5024
- player.on('seeked', vjs.bind(this, this.hide));
5025
-
5026
5037
  player.on('seeking', vjs.bind(this, this.show));
5027
5038
 
5028
5039
  // in some browsers seeking does not trigger the 'playing' event,
@@ -5031,6 +5042,7 @@ vjs.LoadingSpinner = vjs.Component.extend({
5031
5042
  player.on('seeked', vjs.bind(this, this.hide));
5032
5043
 
5033
5044
  player.on('error', vjs.bind(this, this.show));
5045
+ player.on('ended', vjs.bind(this, this.hide));
5034
5046
 
5035
5047
  // Not showing spinner on stalled any more. Browsers may stall and then not trigger any events that would remove the spinner.
5036
5048
  // Checked in Chrome 16 and Safari 5.1.2. http://help.videojs.com/discussions/problems/883-why-is-the-download-progress-showing
@@ -5473,8 +5485,8 @@ vjs.Html5.prototype.setPreload = function(val){ this.el_.preload = val; };
5473
5485
  vjs.Html5.prototype.autoplay = function(){ return this.el_.autoplay; };
5474
5486
  vjs.Html5.prototype.setAutoplay = function(val){ this.el_.autoplay = val; };
5475
5487
 
5476
- vjs.Html5.prototype.controls = function(){ return this.el_.controls; }
5477
- vjs.Html5.prototype.setControls = function(val){ this.el_.controls = !!val; }
5488
+ vjs.Html5.prototype.controls = function(){ return this.el_.controls; };
5489
+ vjs.Html5.prototype.setControls = function(val){ this.el_.controls = !!val; };
5478
5490
 
5479
5491
  vjs.Html5.prototype.loop = function(){ return this.el_.loop; };
5480
5492
  vjs.Html5.prototype.setLoop = function(val){ this.el_.loop = val; };
@@ -5516,6 +5528,53 @@ vjs.Html5.canControlVolume = function(){
5516
5528
  return volume !== vjs.TEST_VID.volume;
5517
5529
  };
5518
5530
 
5531
+ // HTML5 Feature detection and Device Fixes --------------------------------- //
5532
+ (function() {
5533
+ var canPlayType,
5534
+ mpegurlRE = /^application\/(?:x-|vnd\.apple\.)mpegurl/i,
5535
+ mp4RE = /^video\/mp4/i;
5536
+
5537
+ vjs.Html5.patchCanPlayType = function() {
5538
+ // Android 4.0 and above can play HLS to some extent but it reports being unable to do so
5539
+ if (vjs.ANDROID_VERSION >= 4.0) {
5540
+ if (!canPlayType) {
5541
+ canPlayType = vjs.TEST_VID.constructor.prototype.canPlayType;
5542
+ }
5543
+
5544
+ vjs.TEST_VID.constructor.prototype.canPlayType = function(type) {
5545
+ if (type && mpegurlRE.test(type)) {
5546
+ return 'maybe';
5547
+ }
5548
+ return canPlayType.call(this, type);
5549
+ };
5550
+ }
5551
+
5552
+ // Override Android 2.2 and less canPlayType method which is broken
5553
+ if (vjs.IS_OLD_ANDROID) {
5554
+ if (!canPlayType) {
5555
+ canPlayType = vjs.TEST_VID.constructor.prototype.canPlayType;
5556
+ }
5557
+
5558
+ vjs.TEST_VID.constructor.prototype.canPlayType = function(type){
5559
+ if (type && mp4RE.test(type)) {
5560
+ return 'maybe';
5561
+ }
5562
+ return canPlayType.call(this, type);
5563
+ };
5564
+ }
5565
+ };
5566
+
5567
+ vjs.Html5.unpatchCanPlayType = function() {
5568
+ var r = vjs.TEST_VID.constructor.prototype.canPlayType;
5569
+ vjs.TEST_VID.constructor.prototype.canPlayType = canPlayType;
5570
+ canPlayType = null;
5571
+ return r;
5572
+ };
5573
+
5574
+ // by default, patch the video element
5575
+ vjs.Html5.patchCanPlayType();
5576
+ })();
5577
+
5519
5578
  // List of all HTML5 events (various uses).
5520
5579
  vjs.Html5.Events = 'loadstart,suspend,abort,error,emptied,stalled,loadedmetadata,loadeddata,canplay,canplaythrough,playing,waiting,seeking,seeked,ended,durationchange,timeupdate,progress,play,pause,ratechange,volumechange'.split(',');
5521
5580
 
@@ -5550,15 +5609,6 @@ vjs.Html5.disposeMediaElement = function(el){
5550
5609
  })();
5551
5610
  }
5552
5611
  };
5553
-
5554
- // HTML5 Feature detection and Device Fixes --------------------------------- //
5555
-
5556
- // Override Android 2.2 and less canPlayType method which is broken
5557
- if (vjs.IS_OLD_ANDROID) {
5558
- document.createElement('video').constructor.prototype.canPlayType = function(type){
5559
- return (type && type.toLowerCase().indexOf('video/mp4') != -1) ? 'maybe' : '';
5560
- };
5561
- }
5562
5612
  /**
5563
5613
  * @fileoverview VideoJS-SWF - Custom Flash Player with HTML5-ish API
5564
5614
  * https://github.com/zencoder/video-js-swf
@@ -5819,12 +5869,15 @@ vjs.Flash.prototype.pause = function(){
5819
5869
  };
5820
5870
 
5821
5871
  vjs.Flash.prototype.src = function(src){
5872
+ if (src === undefined) {
5873
+ return this.currentSrc();
5874
+ }
5875
+
5822
5876
  if (vjs.Flash.isStreamingSrc(src)) {
5823
5877
  src = vjs.Flash.streamToParts(src);
5824
5878
  this.setRtmpConnection(src.connection);
5825
5879
  this.setRtmpStream(src.stream);
5826
- }
5827
- else {
5880
+ } else {
5828
5881
  // Make sure source URL is abosolute.
5829
5882
  src = vjs.getAbsoluteURL(src);
5830
5883
  this.el_.vjs_src(src);
@@ -5842,8 +5895,8 @@ vjs.Flash.prototype.currentSrc = function(){
5842
5895
  var src = this.el_.vjs_getProperty('currentSrc');
5843
5896
  // no src, check and see if RTMP
5844
5897
  if (src == null) {
5845
- var connection = this.rtmpConnection(),
5846
- stream = this.rtmpStream();
5898
+ var connection = this['rtmpConnection'](),
5899
+ stream = this['rtmpStream']();
5847
5900
 
5848
5901
  if (connection && stream) {
5849
5902
  src = vjs.Flash.streamFromParts(connection, stream);
@@ -5879,8 +5932,8 @@ vjs.Flash.prototype.enterFullScreen = function(){
5879
5932
  // Create setters and getters for attributes
5880
5933
  var api = vjs.Flash.prototype,
5881
5934
  readWrite = 'rtmpConnection,rtmpStream,preload,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted'.split(','),
5882
- readOnly = 'error,currentSrc,networkState,readyState,seeking,initialTime,duration,startOffsetTime,paused,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks'.split(',');
5883
- // Overridden: buffered, currentTime
5935
+ readOnly = 'error,networkState,readyState,seeking,initialTime,duration,startOffsetTime,paused,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks'.split(',');
5936
+ // Overridden: buffered, currentTime, currentSrc
5884
5937
 
5885
5938
  /**
5886
5939
  * @this {*}
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  Video.js Default Styles (http://videojs.com)
3
- Version 4.4.3
3
+ Version 4.5.0
4
4
  Create your own skin at http://designer.videojs.com
5
5
  */
6
6
  /* SKIN
@@ -734,6 +734,10 @@ body.vjs-full-window {
734
734
  left: 1em;
735
735
  right: 1em;
736
736
  }
737
+ /* Move captions down when controls aren't being shown */
738
+ .video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display {
739
+ bottom: 1em;
740
+ }
737
741
  /* Individual tracks */
738
742
  .video-js .vjs-text-track {
739
743
  display: none;
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.4.3
4
+ version: 4.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Behan