videojs_rails 4.7.1 → 4.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/videojs_rails/version.rb +1 -1
- data/vendor/assets/javascripts/video.js.erb +120 -126
- data/vendor/assets/stylesheets/video-js.css.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 918442c5c3c107d5102176634cfb96a5dfc8a81f
|
4
|
+
data.tar.gz: 70718162b1bd7be3555471517b28606b274b9397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06e7d5a5b811ae09b738c2a3b5aca88a69aa4f49a8c9354f124a47de31c73db3e7884ad70fed0ae5767d111c95d0f2f548746640aa465c02b7d26f30fdf580bd
|
7
|
+
data.tar.gz: 6120b8b7459300f6ece61de0a8545431d628c95aaab995c1cbfcaa64f260e450d40ef1463ccf16027a0509351e186090da49d2a6c3fc581204d01d0ac4dcd2bb
|
@@ -1402,15 +1402,6 @@ vjs.parseUrl = function(url) {
|
|
1402
1402
|
return details;
|
1403
1403
|
};
|
1404
1404
|
|
1405
|
-
// if there's no console then don't try to output messages
|
1406
|
-
// they will still be stored in vjs.log.history
|
1407
|
-
var _noop = function(){};
|
1408
|
-
var _console = window['console'] || {
|
1409
|
-
'log': _noop,
|
1410
|
-
'warn': _noop,
|
1411
|
-
'error': _noop
|
1412
|
-
};
|
1413
|
-
|
1414
1405
|
/**
|
1415
1406
|
* Log messags to the console and history based on the type of message
|
1416
1407
|
*
|
@@ -1419,8 +1410,20 @@ var _console = window['console'] || {
|
|
1419
1410
|
* @private
|
1420
1411
|
*/
|
1421
1412
|
function _logType(type, args){
|
1413
|
+
var argsArray, noop, console;
|
1414
|
+
|
1422
1415
|
// convert args to an array to get array functions
|
1423
|
-
|
1416
|
+
argsArray = Array.prototype.slice.call(args);
|
1417
|
+
// if there's no console then don't try to output messages
|
1418
|
+
// they will still be stored in vjs.log.history
|
1419
|
+
// Was setting these once outside of this function, but containing them
|
1420
|
+
// in the function makes it easier to test cases where console doesn't exist
|
1421
|
+
noop = function(){};
|
1422
|
+
console = window['console'] || {
|
1423
|
+
'log': noop,
|
1424
|
+
'warn': noop,
|
1425
|
+
'error': noop
|
1426
|
+
};
|
1424
1427
|
|
1425
1428
|
if (type) {
|
1426
1429
|
// add the type to the front of the message
|
@@ -1437,11 +1440,11 @@ function _logType(type, args){
|
|
1437
1440
|
argsArray.unshift('VIDEOJS:');
|
1438
1441
|
|
1439
1442
|
// call appropriate log function
|
1440
|
-
if (
|
1441
|
-
|
1443
|
+
if (console[type].apply) {
|
1444
|
+
console[type].apply(console, argsArray);
|
1442
1445
|
} else {
|
1443
1446
|
// ie8 doesn't allow error.apply, but it will just join() the array anyway
|
1444
|
-
|
1447
|
+
console[type](argsArray.join(' '));
|
1445
1448
|
}
|
1446
1449
|
}
|
1447
1450
|
|
@@ -3409,10 +3412,6 @@ vjs.Player.prototype.dispose = function(){
|
|
3409
3412
|
if (this.tag && this.tag['player']) { this.tag['player'] = null; }
|
3410
3413
|
if (this.el_ && this.el_['player']) { this.el_['player'] = null; }
|
3411
3414
|
|
3412
|
-
// Ensure that tracking progress and time progress will stop and plater deleted
|
3413
|
-
this.stopTrackingProgress();
|
3414
|
-
this.stopTrackingCurrentTime();
|
3415
|
-
|
3416
3415
|
if (this.tech) { this.tech.dispose(); }
|
3417
3416
|
|
3418
3417
|
// Component dispose
|
@@ -3557,16 +3556,6 @@ vjs.Player.prototype.loadTech = function(techName, source){
|
|
3557
3556
|
|
3558
3557
|
var techReady = function(){
|
3559
3558
|
this.player_.triggerReady();
|
3560
|
-
|
3561
|
-
// Manually track progress in cases where the browser/flash player doesn't report it.
|
3562
|
-
if (!this.features['progressEvents']) {
|
3563
|
-
this.player_.manualProgressOn();
|
3564
|
-
}
|
3565
|
-
|
3566
|
-
// Manually track timeudpates in cases where the browser/flash player doesn't report it.
|
3567
|
-
if (!this.features['timeupdateEvents']) {
|
3568
|
-
this.player_.manualTimeUpdatesOn();
|
3569
|
-
}
|
3570
3559
|
};
|
3571
3560
|
|
3572
3561
|
// Grab tech-specific options from player options and add source and parent element to use.
|
@@ -3590,11 +3579,6 @@ vjs.Player.prototype.loadTech = function(techName, source){
|
|
3590
3579
|
vjs.Player.prototype.unloadTech = function(){
|
3591
3580
|
this.isReady_ = false;
|
3592
3581
|
|
3593
|
-
// Turn off any manual progress or timeupdate tracking
|
3594
|
-
if (this.manualProgress) { this.manualProgressOff(); }
|
3595
|
-
|
3596
|
-
if (this.manualTimeUpdates) { this.manualTimeUpdatesOff(); }
|
3597
|
-
|
3598
3582
|
this.tech.dispose();
|
3599
3583
|
|
3600
3584
|
this.tech = false;
|
@@ -3614,98 +3598,7 @@ vjs.Player.prototype.unloadTech = function(){
|
|
3614
3598
|
// vjs.log('loadedTech')
|
3615
3599
|
// },
|
3616
3600
|
|
3617
|
-
/* Fallbacks for unsupported event types
|
3618
|
-
================================================================================ */
|
3619
|
-
// Manually trigger progress events based on changes to the buffered amount
|
3620
|
-
// Many flash players and older HTML5 browsers don't send progress or progress-like events
|
3621
|
-
vjs.Player.prototype.manualProgressOn = function(){
|
3622
|
-
this.manualProgress = true;
|
3623
|
-
|
3624
|
-
// Trigger progress watching when a source begins loading
|
3625
|
-
this.trackProgress();
|
3626
|
-
|
3627
|
-
// Watch for a native progress event call on the tech element
|
3628
|
-
// In HTML5, some older versions don't support the progress event
|
3629
|
-
// So we're assuming they don't, and turning off manual progress if they do.
|
3630
|
-
// As opposed to doing user agent detection
|
3631
|
-
if (this.tech) {
|
3632
|
-
this.tech.one('progress', function(){
|
3633
|
-
|
3634
|
-
// Update known progress support for this playback technology
|
3635
|
-
this.features['progressEvents'] = true;
|
3636
|
-
|
3637
|
-
// Turn off manual progress tracking
|
3638
|
-
this.player_.manualProgressOff();
|
3639
|
-
});
|
3640
|
-
}
|
3641
|
-
};
|
3642
|
-
|
3643
|
-
vjs.Player.prototype.manualProgressOff = function(){
|
3644
|
-
this.manualProgress = false;
|
3645
|
-
this.stopTrackingProgress();
|
3646
|
-
};
|
3647
|
-
|
3648
|
-
vjs.Player.prototype.trackProgress = function(){
|
3649
|
-
|
3650
|
-
this.progressInterval = setInterval(vjs.bind(this, function(){
|
3651
|
-
// Don't trigger unless buffered amount is greater than last time
|
3652
|
-
|
3653
|
-
var bufferedPercent = this.bufferedPercent();
|
3654
|
-
|
3655
|
-
if (this.cache_.bufferedPercent != bufferedPercent) {
|
3656
|
-
this.trigger('progress');
|
3657
|
-
}
|
3658
|
-
|
3659
|
-
this.cache_.bufferedPercent = bufferedPercent;
|
3660
|
-
|
3661
|
-
if (bufferedPercent == 1) {
|
3662
|
-
this.stopTrackingProgress();
|
3663
|
-
}
|
3664
|
-
}), 500);
|
3665
|
-
};
|
3666
|
-
vjs.Player.prototype.stopTrackingProgress = function(){ clearInterval(this.progressInterval); };
|
3667
|
-
|
3668
|
-
/*! Time Tracking -------------------------------------------------------------- */
|
3669
|
-
vjs.Player.prototype.manualTimeUpdatesOn = function(){
|
3670
|
-
this.manualTimeUpdates = true;
|
3671
|
-
|
3672
|
-
this.on('play', this.trackCurrentTime);
|
3673
|
-
this.on('pause', this.stopTrackingCurrentTime);
|
3674
|
-
// timeupdate is also called by .currentTime whenever current time is set
|
3675
|
-
|
3676
|
-
// Watch for native timeupdate event
|
3677
|
-
if (this.tech) {
|
3678
|
-
this.tech.one('timeupdate', function(){
|
3679
|
-
// Update known progress support for this playback technology
|
3680
|
-
this.features['timeupdateEvents'] = true;
|
3681
|
-
// Turn off manual progress tracking
|
3682
|
-
this.player_.manualTimeUpdatesOff();
|
3683
|
-
});
|
3684
|
-
}
|
3685
|
-
};
|
3686
|
-
|
3687
|
-
vjs.Player.prototype.manualTimeUpdatesOff = function(){
|
3688
|
-
this.manualTimeUpdates = false;
|
3689
|
-
this.stopTrackingCurrentTime();
|
3690
|
-
this.off('play', this.trackCurrentTime);
|
3691
|
-
this.off('pause', this.stopTrackingCurrentTime);
|
3692
|
-
};
|
3693
|
-
|
3694
|
-
vjs.Player.prototype.trackCurrentTime = function(){
|
3695
|
-
if (this.currentTimeInterval) { this.stopTrackingCurrentTime(); }
|
3696
|
-
this.currentTimeInterval = setInterval(vjs.bind(this, function(){
|
3697
|
-
this.trigger('timeupdate');
|
3698
|
-
}), 250); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15
|
3699
|
-
};
|
3700
|
-
|
3701
|
-
// Turn off play progress tracking (when paused or dragging)
|
3702
|
-
vjs.Player.prototype.stopTrackingCurrentTime = function(){
|
3703
|
-
clearInterval(this.currentTimeInterval);
|
3704
3601
|
|
3705
|
-
// #1002 - if the video ends right before the next timeupdate would happen,
|
3706
|
-
// the progress bar won't make it all the way to the end
|
3707
|
-
this.trigger('timeupdate');
|
3708
|
-
};
|
3709
3602
|
// /* Player event handlers (how the player reacts to certain events)
|
3710
3603
|
// ================================================================================ */
|
3711
3604
|
|
@@ -4028,9 +3921,6 @@ vjs.Player.prototype.currentTime = function(seconds){
|
|
4028
3921
|
|
4029
3922
|
this.techCall('setCurrentTime', seconds);
|
4030
3923
|
|
4031
|
-
// improve the accuracy of manual timeupdates
|
4032
|
-
if (this.manualTimeUpdates) { this.trigger('timeupdate'); }
|
4033
|
-
|
4034
3924
|
return this;
|
4035
3925
|
}
|
4036
3926
|
|
@@ -5996,6 +5886,16 @@ vjs.MediaTechController = vjs.Component.extend({
|
|
5996
5886
|
options.reportTouchActivity = false;
|
5997
5887
|
vjs.Component.call(this, player, options, ready);
|
5998
5888
|
|
5889
|
+
// Manually track progress in cases where the browser/flash player doesn't report it.
|
5890
|
+
if (!this.features['progressEvents']) {
|
5891
|
+
this.manualProgressOn();
|
5892
|
+
}
|
5893
|
+
|
5894
|
+
// Manually track timeudpates in cases where the browser/flash player doesn't report it.
|
5895
|
+
if (!this.features['timeupdateEvents']) {
|
5896
|
+
this.manualTimeUpdatesOn();
|
5897
|
+
}
|
5898
|
+
|
5999
5899
|
this.initControlsListeners();
|
6000
5900
|
}
|
6001
5901
|
});
|
@@ -6131,6 +6031,96 @@ vjs.MediaTechController.prototype.onTap = function(){
|
|
6131
6031
|
this.player().userActive(!this.player().userActive());
|
6132
6032
|
};
|
6133
6033
|
|
6034
|
+
/* Fallbacks for unsupported event types
|
6035
|
+
================================================================================ */
|
6036
|
+
// Manually trigger progress events based on changes to the buffered amount
|
6037
|
+
// Many flash players and older HTML5 browsers don't send progress or progress-like events
|
6038
|
+
vjs.MediaTechController.prototype.manualProgressOn = function(){
|
6039
|
+
this.manualProgress = true;
|
6040
|
+
|
6041
|
+
// Trigger progress watching when a source begins loading
|
6042
|
+
this.trackProgress();
|
6043
|
+
};
|
6044
|
+
|
6045
|
+
vjs.MediaTechController.prototype.manualProgressOff = function(){
|
6046
|
+
this.manualProgress = false;
|
6047
|
+
this.stopTrackingProgress();
|
6048
|
+
};
|
6049
|
+
|
6050
|
+
vjs.MediaTechController.prototype.trackProgress = function(){
|
6051
|
+
|
6052
|
+
this.progressInterval = setInterval(vjs.bind(this, function(){
|
6053
|
+
// Don't trigger unless buffered amount is greater than last time
|
6054
|
+
|
6055
|
+
var bufferedPercent = this.player().bufferedPercent();
|
6056
|
+
|
6057
|
+
if (this.bufferedPercent_ != bufferedPercent) {
|
6058
|
+
this.player().trigger('progress');
|
6059
|
+
}
|
6060
|
+
|
6061
|
+
this.bufferedPercent_ = bufferedPercent;
|
6062
|
+
|
6063
|
+
if (bufferedPercent === 1) {
|
6064
|
+
this.stopTrackingProgress();
|
6065
|
+
}
|
6066
|
+
}), 500);
|
6067
|
+
};
|
6068
|
+
vjs.MediaTechController.prototype.stopTrackingProgress = function(){ clearInterval(this.progressInterval); };
|
6069
|
+
|
6070
|
+
/*! Time Tracking -------------------------------------------------------------- */
|
6071
|
+
vjs.MediaTechController.prototype.manualTimeUpdatesOn = function(){
|
6072
|
+
this.manualTimeUpdates = true;
|
6073
|
+
|
6074
|
+
this.player().on('play', vjs.bind(this, this.trackCurrentTime));
|
6075
|
+
this.player().on('pause', vjs.bind(this, this.stopTrackingCurrentTime));
|
6076
|
+
// timeupdate is also called by .currentTime whenever current time is set
|
6077
|
+
|
6078
|
+
// Watch for native timeupdate event
|
6079
|
+
this.one('timeupdate', function(){
|
6080
|
+
// Update known progress support for this playback technology
|
6081
|
+
this.features['timeupdateEvents'] = true;
|
6082
|
+
// Turn off manual progress tracking
|
6083
|
+
this.manualTimeUpdatesOff();
|
6084
|
+
});
|
6085
|
+
};
|
6086
|
+
|
6087
|
+
vjs.MediaTechController.prototype.manualTimeUpdatesOff = function(){
|
6088
|
+
this.manualTimeUpdates = false;
|
6089
|
+
this.stopTrackingCurrentTime();
|
6090
|
+
this.off('play', this.trackCurrentTime);
|
6091
|
+
this.off('pause', this.stopTrackingCurrentTime);
|
6092
|
+
};
|
6093
|
+
|
6094
|
+
vjs.MediaTechController.prototype.trackCurrentTime = function(){
|
6095
|
+
if (this.currentTimeInterval) { this.stopTrackingCurrentTime(); }
|
6096
|
+
this.currentTimeInterval = setInterval(vjs.bind(this, function(){
|
6097
|
+
this.player().trigger('timeupdate');
|
6098
|
+
}), 250); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15
|
6099
|
+
};
|
6100
|
+
|
6101
|
+
// Turn off play progress tracking (when paused or dragging)
|
6102
|
+
vjs.MediaTechController.prototype.stopTrackingCurrentTime = function(){
|
6103
|
+
clearInterval(this.currentTimeInterval);
|
6104
|
+
|
6105
|
+
// #1002 - if the video ends right before the next timeupdate would happen,
|
6106
|
+
// the progress bar won't make it all the way to the end
|
6107
|
+
this.player().trigger('timeupdate');
|
6108
|
+
};
|
6109
|
+
|
6110
|
+
vjs.MediaTechController.prototype.dispose = function() {
|
6111
|
+
// Turn off any manual progress or timeupdate tracking
|
6112
|
+
if (this.manualProgress) { this.manualProgressOff(); }
|
6113
|
+
|
6114
|
+
if (this.manualTimeUpdates) { this.manualTimeUpdatesOff(); }
|
6115
|
+
|
6116
|
+
vjs.Component.prototype.dispose.call(this);
|
6117
|
+
};
|
6118
|
+
|
6119
|
+
vjs.MediaTechController.prototype.setCurrentTime = function() {
|
6120
|
+
// improve the accuracy of manual timeupdates
|
6121
|
+
if (this.manualTimeUpdates) { this.player().trigger('timeupdate'); }
|
6122
|
+
};
|
6123
|
+
|
6134
6124
|
/**
|
6135
6125
|
* Provide a default setPoster method for techs
|
6136
6126
|
*
|
@@ -6179,6 +6169,9 @@ vjs.Html5 = vjs.MediaTechController.extend({
|
|
6179
6169
|
// HTML video is able to automatically resize when going to fullscreen
|
6180
6170
|
this.features['fullscreenResize'] = true;
|
6181
6171
|
|
6172
|
+
// HTML video supports progress events
|
6173
|
+
this.features['progressEvents'] = true;
|
6174
|
+
|
6182
6175
|
vjs.MediaTechController.call(this, player, options, ready);
|
6183
6176
|
this.setupTriggers();
|
6184
6177
|
|
@@ -6672,6 +6665,7 @@ vjs.Flash.prototype.src = function(src){
|
|
6672
6665
|
vjs.Flash.prototype['setCurrentTime'] = function(time){
|
6673
6666
|
this.lastSeekTarget_ = time;
|
6674
6667
|
this.el_.vjs_setProperty('currentTime', time);
|
6668
|
+
vjs.MediaTechController.prototype.setCurrentTime.call(this);
|
6675
6669
|
};
|
6676
6670
|
|
6677
6671
|
vjs.Flash.prototype['currentTime'] = function(time){
|