shaka-player 4.6.16 → 4.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/locales.js +32 -32
- package/dist/shaka-player.compiled.debug.js +10 -11
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +202 -201
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.debug.js +12 -14
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +229 -228
- package/dist/shaka-player.ui.map +3 -3
- package/docs/tutorials/faq.md +13 -0
- package/docs/tutorials/offline.md +3 -0
- package/lib/media/playhead.js +3 -3
- package/lib/media/streaming_engine.js +1 -13
- package/lib/player.js +7 -3
- package/lib/util/stream_utils.js +2 -3
- package/package.json +1 -1
- package/test/media/playhead_unit.js +1 -1
package/docs/tutorials/faq.md
CHANGED
|
@@ -245,6 +245,19 @@ the following configuration:
|
|
|
245
245
|
player.configure('manifest.hls.liveSegmentsDelay', 1);
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
+
<hr>
|
|
249
|
+
|
|
250
|
+
**Q:** Why can I not find the new version of Shaka Player on
|
|
251
|
+
ajax.googleapis.com?
|
|
252
|
+
|
|
253
|
+
**A:** When a new version of Shaka Player is released on GitHub, it has to
|
|
254
|
+
undergo a brief manual review process before it can be uploaded to Google's
|
|
255
|
+
servers. After approval, the upload process then usually takes several hours.
|
|
256
|
+
Therefore it is not unusual for a day or two to pass before a new version of
|
|
257
|
+
Shaka Player is hosted on Google's ajax.googleapis.com website. We ask for your
|
|
258
|
+
patience in these matters.
|
|
259
|
+
|
|
260
|
+
|
|
248
261
|
[386]: https://github.com/shaka-project/shaka-player/issues/386#issuecomment-227898001
|
|
249
262
|
[489]: https://github.com/shaka-project/shaka-player/issues/489#issuecomment-240466224
|
|
250
263
|
[743]: https://github.com/shaka-project/shaka-player/issues/743
|
|
@@ -340,6 +340,9 @@ you want.
|
|
|
340
340
|
At this point, the content is now stored offline and it's ready to be played.
|
|
341
341
|
Next we will add functionality to play offline content.
|
|
342
342
|
|
|
343
|
+
Note: If you call `storage.store` twice with the same manifestUri as input,
|
|
344
|
+
you'll download the same manifestUri twice.
|
|
345
|
+
|
|
343
346
|
## Playing Offline Content
|
|
344
347
|
|
|
345
348
|
Now that we have stored some content, we want to play it. To do this, resolve
|
package/lib/media/playhead.js
CHANGED
|
@@ -382,10 +382,10 @@ shaka.media.MediaSourcePlayhead = class {
|
|
|
382
382
|
seekStart = seekEnd - this.minSeekRange_;
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
if (currentTime < seekStart) {
|
|
386
|
-
//
|
|
385
|
+
if (currentTime < seekStart || currentTime > seekEnd) {
|
|
386
|
+
// playhead is outside of the seekrange. Move playhead to catch up.
|
|
387
387
|
const targetTime = this.reposition_(currentTime);
|
|
388
|
-
shaka.log.info('Jumping
|
|
388
|
+
shaka.log.info('Jumping by ' + (targetTime - currentTime) +
|
|
389
389
|
' seconds to catch up with the seek range.');
|
|
390
390
|
this.mediaElement_.currentTime = targetTime;
|
|
391
391
|
}
|
|
@@ -878,7 +878,6 @@ shaka.media.StreamingEngine = class {
|
|
|
878
878
|
// The playhead might be seeking on startup, if a start time is set, so
|
|
879
879
|
// start "seeked" as true.
|
|
880
880
|
seeked: true,
|
|
881
|
-
needsResync: false,
|
|
882
881
|
recovering: false,
|
|
883
882
|
hasError: false,
|
|
884
883
|
operation: null,
|
|
@@ -1245,11 +1244,6 @@ shaka.media.StreamingEngine = class {
|
|
|
1245
1244
|
shaka.log.v1(
|
|
1246
1245
|
logPrefix, 'looking up segment from new stream endTime:', time);
|
|
1247
1246
|
|
|
1248
|
-
// Using a new iterator means we need to resync the stream in sequence
|
|
1249
|
-
// mode. The buffered range might not align perfectly with the last
|
|
1250
|
-
// segment end time, so we may end up repeating a segment. Resyncing
|
|
1251
|
-
// makes this safe to do.
|
|
1252
|
-
mediaState.needsResync = true;
|
|
1253
1247
|
mediaState.segmentIterator =
|
|
1254
1248
|
mediaState.stream.segmentIndex.getIteratorForTime(time);
|
|
1255
1249
|
const ref = mediaState.segmentIterator &&
|
|
@@ -1869,9 +1863,7 @@ shaka.media.StreamingEngine = class {
|
|
|
1869
1863
|
// Across discontinuity bounds, we should resync timestamps for
|
|
1870
1864
|
// sequence mode playbacks. The next segment appended should
|
|
1871
1865
|
// land at its theoretical timestamp from the segment index.
|
|
1872
|
-
if (reference.discontinuitySequence != lastDiscontinuitySequence
|
|
1873
|
-
mediaState.needsResync) {
|
|
1874
|
-
mediaState.needsResync = false;
|
|
1866
|
+
if (reference.discontinuitySequence != lastDiscontinuitySequence) {
|
|
1875
1867
|
operations.push(this.playerInterface_.mediaSourceEngine.resync(
|
|
1876
1868
|
mediaState.type, reference.startTime));
|
|
1877
1869
|
}
|
|
@@ -2541,7 +2533,6 @@ shaka.media.StreamingEngine.PlayerInterface;
|
|
|
2541
2533
|
* clearBufferSafeMargin: number,
|
|
2542
2534
|
* clearingBuffer: boolean,
|
|
2543
2535
|
* seeked: boolean,
|
|
2544
|
-
* needsResync: boolean,
|
|
2545
2536
|
* adaptation: boolean,
|
|
2546
2537
|
* recovering: boolean,
|
|
2547
2538
|
* hasError: boolean,
|
|
@@ -2596,9 +2587,6 @@ shaka.media.StreamingEngine.PlayerInterface;
|
|
|
2596
2587
|
* True indicates that the presentation just seeked.
|
|
2597
2588
|
* @property {boolean} adaptation
|
|
2598
2589
|
* True indicates that the presentation just automatically switched variants.
|
|
2599
|
-
* @property {boolean} needsResync
|
|
2600
|
-
* True indicates that the stream needs to be resynced in sequence mode,
|
|
2601
|
-
* regardless of discontinuity sequence.
|
|
2602
2590
|
* @property {boolean} recovering
|
|
2603
2591
|
* True indicates that the last segment was not appended because it could not
|
|
2604
2592
|
* fit in the buffer.
|
package/lib/player.js
CHANGED
|
@@ -3544,12 +3544,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
3544
3544
|
const currentTime = this.video_.currentTime;
|
|
3545
3545
|
const seekRange = this.seekRange();
|
|
3546
3546
|
const safeSeekOffset = this.config_.streaming.safeSeekOffset;
|
|
3547
|
+
|
|
3548
|
+
// Cancel trick play if we hit the beginning or end of the seekable
|
|
3549
|
+
// (Sub-second accuracy not required here)
|
|
3547
3550
|
if (rate > 0) {
|
|
3548
|
-
if (currentTime >= seekRange.end) {
|
|
3551
|
+
if (Math.floor(currentTime) >= Math.floor(seekRange.end)) {
|
|
3549
3552
|
this.cancelTrickPlay();
|
|
3550
3553
|
}
|
|
3551
3554
|
} else {
|
|
3552
|
-
if (currentTime <=
|
|
3555
|
+
if (Math.floor(currentTime) <=
|
|
3556
|
+
Math.floor(seekRange.start + safeSeekOffset)) {
|
|
3553
3557
|
this.cancelTrickPlay();
|
|
3554
3558
|
}
|
|
3555
3559
|
}
|
|
@@ -6850,7 +6854,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
|
|
|
6850
6854
|
* @export
|
|
6851
6855
|
*/
|
|
6852
6856
|
// eslint-disable-next-line no-useless-concat
|
|
6853
|
-
shaka.Player.version = 'v4.6.
|
|
6857
|
+
shaka.Player.version = 'v4.6.17' + '-uncompiled'; // x-release-please-version
|
|
6854
6858
|
|
|
6855
6859
|
// Initialize the deprecation system using the version string we just set
|
|
6856
6860
|
// on the player.
|
package/lib/util/stream_utils.js
CHANGED
|
@@ -1321,8 +1321,6 @@ shaka.util.StreamUtils = class {
|
|
|
1321
1321
|
* @return {shaka.extern.Track}
|
|
1322
1322
|
*/
|
|
1323
1323
|
static html5TextTrackToTrack(textTrack) {
|
|
1324
|
-
const CLOSED_CAPTION_MIMETYPE =
|
|
1325
|
-
shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE;
|
|
1326
1324
|
const StreamUtils = shaka.util.StreamUtils;
|
|
1327
1325
|
|
|
1328
1326
|
/** @type {shaka.extern.Track} */
|
|
@@ -1331,7 +1329,8 @@ shaka.util.StreamUtils = class {
|
|
|
1331
1329
|
track.type = 'text';
|
|
1332
1330
|
track.originalTextId = textTrack.id;
|
|
1333
1331
|
if (textTrack.kind == 'captions') {
|
|
1334
|
-
|
|
1332
|
+
// See: https://github.com/shaka-project/shaka-player/issues/6233
|
|
1333
|
+
track.mimeType = 'unknown';
|
|
1335
1334
|
}
|
|
1336
1335
|
if (textTrack.kind == 'subtitles') {
|
|
1337
1336
|
track.mimeType = 'text/vtt';
|
package/package.json
CHANGED
|
@@ -683,7 +683,7 @@ describe('Playhead', () => {
|
|
|
683
683
|
|
|
684
684
|
// It should allow a small buffer around the seek range.
|
|
685
685
|
seekCount = 0;
|
|
686
|
-
currentTime = 1030
|
|
686
|
+
currentTime = 1030;
|
|
687
687
|
jasmine.clock().tick(500);
|
|
688
688
|
currentTime = 1027.9233;
|
|
689
689
|
jasmine.clock().tick(500);
|