Skip to content

Commit c5ded88

Browse files
committed
1.3.6
1 parent b32dba7 commit c5ded88

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

dist/danmaku.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(function (global, factory) {
22
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
33
typeof define === 'function' && define.amd ? define(factory) :
4-
(global.Danmaku = factory());
5-
}(this, (function () { 'use strict';
4+
(global = global || self, global.Danmaku = factory());
5+
}(this, function () { 'use strict';
66

77
/* eslint no-invalid-this: 0 */
88
function allocate(cmt) {
@@ -130,6 +130,10 @@
130130
if (cmtt >= ct) {
131131
break;
132132
}
133+
if (ct - cmtt > this.duration) {
134+
++this.position;
135+
continue;
136+
}
133137
if (this._hasMedia) {
134138
cmt._utc = dn - (this.media.currentTime - cmt.time);
135139
}
@@ -177,7 +181,7 @@
177181
}
178182
var height = 12;
179183
// eslint-disable-next-line max-len
180-
var regex = /^(\d+(?:\.\d+)?)(px|%|em|rem)(?:\s*\/\s*(\d+(?:\.\d+)?)(px|%|em|rem)?)?/;
184+
var regex = /(\d+(?:\.\d+)?)(px|%|em|rem)(?:\s*\/\s*(\d+(?:\.\d+)?)(px|%|em|rem)?)?/;
181185
var p = font.match(regex);
182186
if (p) {
183187
var fs = p[1] * 1 || 10;
@@ -268,6 +272,10 @@
268272
if (cmtt >= ct) {
269273
break;
270274
}
275+
if (ct - cmtt > this.duration) {
276+
++this.position;
277+
continue;
278+
}
271279
if (this._hasMedia) {
272280
cmt._utc = dn - (this.media.currentTime - cmt.time);
273281
}
@@ -696,4 +704,4 @@
696704

697705
return Danmaku;
698706

699-
})));
707+
}));

0 commit comments

Comments
 (0)