Skip to content

Commit 4798f92

Browse files
author
Can Küçükyılmaz
committed
v0.2.1
2 parents fd535f5 + 76b8c4c commit 4798f92

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

dist/videojs-time-offset.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* videojs-time-offset
3-
* @version 0.2.0
3+
* @version 0.2.1
44
* @copyright 2016 Can Küçükyılmaz <can@vngrs.com>
55
* @license MIT
66
*/
@@ -143,7 +143,9 @@ var onPlayerReady = function onPlayerReady(player, options) {
143143

144144
var current = __monkey__.currentTime.call(player) - offsetStart;
145145

146-
if (current < 0) {
146+
// in safari with hls, it returns floating number numbers, fix it
147+
if (Math.ceil(current) < 0) {
148+
player.pause();
147149
player.currentTime(0);
148150
return 0;
149151
}

dist/videojs-time-offset.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "videojs-time-offset",
33
"description": "",
44
"main": "es5/plugin.js",
5-
"version": "0.2.0",
5+
"version": "0.2.1",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/dogusdigital/videojs-time-offset.git"

src/plugin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ const onPlayerReady = (player, options) => {
121121

122122
const current = __monkey__.currentTime.call(player) - offsetStart;
123123

124-
if (current < 0) {
124+
// in safari with hls, it returns floating number numbers, fix it
125+
if (Math.ceil(current) < 0) {
126+
player.pause();
125127
player.currentTime(0);
126128
return 0;
127129
}

0 commit comments

Comments
 (0)