mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-15 16:06:41 +03:00
@@ -1336,10 +1336,10 @@ shaka.text.TtmlTextParser.timeColonFormat_ = /^(?:(\d{2,}):)?(\d{2}):(\d{2})$/;
|
||||
/**
|
||||
* @const
|
||||
* @private {!RegExp}
|
||||
* @example 01:02:43.0345555 or 02:43.03
|
||||
* @example 01:02:43.0345555 or 02:43.03 or 02:45.5
|
||||
*/
|
||||
shaka.text.TtmlTextParser.timeColonFormatMilliseconds_ =
|
||||
/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/;
|
||||
/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/;
|
||||
|
||||
/**
|
||||
* @const
|
||||
|
||||
@@ -358,6 +358,18 @@ describe('TtmlTextParser', () => {
|
||||
{startTime: 62.05, endTime: 3723.2});
|
||||
});
|
||||
|
||||
it('supports colon formatted time with 0 or 1 dp', () => {
|
||||
verifyHelper(
|
||||
[
|
||||
{startTime: 62, endTime: 3723.2, payload: 'Test'},
|
||||
],
|
||||
'<tt><body><div>' +
|
||||
'<p begin="01:02" end="01:02:03.2">Test</p>' +
|
||||
'</div></body></tt>',
|
||||
{periodStart: 0, segmentStart: 60, segmentEnd: 3730, vttOffset: 0},
|
||||
{startTime: 62, endTime: 3723.2});
|
||||
});
|
||||
|
||||
it('accounts for offset', () => {
|
||||
verifyHelper(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user