bigscreen-player
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "bigscreen-player", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Simplified media playback for bigscreen devices.", | ||
@@ -5,0 +5,0 @@ "main": "script/bigscreenplayer.js", |
@@ -70,4 +70,3 @@ require( | ||
['initialize', 'getDebug', 'getSource', 'on', 'off', 'time', 'duration', 'attachSource', | ||
'reset', 'isPaused', 'pause', 'play', 'seek', 'isReady', 'refreshManifest', 'getDashMetrics', 'getMetricsFor', | ||
'setBufferToKeep', 'setBufferAheadToKeep', 'setBufferTimeAtTopQuality', 'setBufferTimeAtTopQualityLongForm']); | ||
'reset', 'isPaused', 'pause', 'play', 'seek', 'isReady', 'refreshManifest', 'getDashMetrics', 'getMetricsFor']); | ||
@@ -509,4 +508,29 @@ mockDashInstance.duration.and.returnValue(101); | ||
}); | ||
describe('sliding window', function () { | ||
beforeEach(function () { | ||
setUpMSE(0, WindowTypes.SLIDING, MediaKinds.VIDEO); | ||
mseStrategy.load(null, null, 0); | ||
}); | ||
it('should set current time on the video element', function () { | ||
mseStrategy.setCurrentTime(12); | ||
expect(mockVideoElement.currentTime).toBe(12); | ||
}); | ||
it('should clamp the seek to the start of the seekable range', function () { | ||
mseStrategy.setCurrentTime(-0.1); | ||
expect(mockVideoElement.currentTime).toBe(0); | ||
}); | ||
it('should clamp the seek to 1.1s before the end of the seekable range', function () { | ||
mseStrategy.setCurrentTime(101); | ||
expect(mockVideoElement.currentTime).toBe(99.9); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -127,8 +127,2 @@ define('bigscreenplayer/playbackstrategy/msestrategy', | ||
mediaPlayer.getDebug().setLogToBrowserConsole(false); | ||
mediaPlayer.setBufferToKeep(0); | ||
mediaPlayer.setBufferAheadToKeep(20); | ||
mediaPlayer.setBufferTimeAtTopQuality(20); | ||
mediaPlayer.setBufferTimeAtTopQualityLongForm(20); | ||
mediaPlayer.initialize(mediaElement, src, true); | ||
@@ -282,6 +276,8 @@ } | ||
var seekToTime = getClampedTime(time, this.getSeekableRange()); | ||
if (windowType === WindowTypes.SLIDING) { | ||
mediaElement.currentTime = (time + timeCorrection); | ||
mediaElement.currentTime = (seekToTime + timeCorrection); | ||
} else { | ||
mediaPlayer.seek(getClampedTime(time, this.getSeekableRange())); | ||
mediaPlayer.seek(seekToTime); | ||
} | ||
@@ -288,0 +284,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
357922
7678