Skip to content

Commit 7df3321

Browse files
authored
feat: Add TS transmuxer for muxed content (#5571)
1 parent 5fa8b42 commit 7df3321

40 files changed

+236
-575
lines changed

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ HLS features supported:
132132
blocking playlist reload
133133
- Discontinuity
134134
- ISO-BMFF / MP4 / CMAF support
135-
- MPEG-2 TS support (transmuxing provided by [mux.js][] v6.2.0+, must be
136-
separately included)
135+
- MPEG-2 TS support
137136
- WebVTT and TTML
138137
- CEA-608/708 captions
139138
- Encrypted content with PlayReady and Widevine
@@ -144,7 +143,6 @@ HLS features supported:
144143
HLS features **not** supported:
145144
- I-frame-only playlists: https://github.com/shaka-project/shaka-player/issues/742
146145

147-
[mux.js]: https://github.com/videojs/mux.js/releases
148146

149147
## MPEG-5 Part2 LCEVC Support
150148

@@ -235,8 +233,7 @@ Shaka Player supports:
235233
SegmentTemplate@index
236234
- Not supported in HLS
237235
- MPEG-2 TS
238-
- With help from [mux.js][] v6.2.0+, can be played on any browser which
239-
supports MP4
236+
- Can be played on any browser which supports MP4
240237
- Can find and parse timestamps to find segment start time in HLS
241238
- WebVTT
242239
- Supported in both text form and embedded in MP4
@@ -289,8 +286,7 @@ Shaka Player supports:
289286
- MP3 in MPEG-2 TS to MP3 in MP4
290287
- MP3 in MPEG-2 TS to raw MP3
291288
- H.264 in MPEG-2 TS to H.264 in MP4
292-
- Muxed AAC and H.264 in MPEG-2 TS to AAC and H.264 in MP4,
293-
with help from [mux.js][] v6.2.0+
289+
- Muxed content in MPEG-2 TS with the previous codecs
294290

295291

296292
## Thumbnails support

build/types/transmuxer

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
+../../lib/transmuxer/mp3_transmuxer.js
1111
+../../lib/transmuxer/mpeg_audio.js
1212
+../../lib/transmuxer/mpeg_ts_transmuxer.js
13-
+../../lib/transmuxer/muxjs_transmuxer.js
1413
+../../lib/transmuxer/ts_transmuxer.js

demo/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
<link rel="stylesheet" href="../dist/controls.css">
3737

3838
<script defer src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
39-
<!-- transmuxing support is enabled by including this: -->
40-
<script defer src="../node_modules/mux.js/dist/mux.min.js"></script>
4139
<!-- MSS support is enabled by including this: -->
4240
<script defer src="../node_modules/codem-isoboxer/dist/iso_boxer.min.js"></script>
4341
<!-- MPEG-5 Part2 LCEVC support is enabled by including this: -->

demo/service_worker.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ const OPTIONAL_RESOURCES = [
9292
'https://shaka-player-demo.appspot.com/assets/poster.jpg',
9393
'https://shaka-player-demo.appspot.com/assets/audioOnly.gif',
9494

95-
// The mux.js transmuxing library for MPEG-2 TS and CEA support.
96-
'../node_modules/mux.js/dist/mux.min.js',
97-
9895
// The codem-isoboxer library for MSS support.
9996
'../node_modules/codem-isoboxer/dist/iso_boxer.min.js',
10097

docs/tutorials/faq.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,6 @@ configure {@link shaka.extern.StreamingConfiguration|
106106

107107
<hr>
108108

109-
**Q:** Why doesn't my HLS content work?
110-
111-
**A:** If your HLS content uses MPEG2-TS, you may need to enable transmuxing.
112-
The only browsers capable of playing TS natively are Edge and Chromecast. You
113-
will get a `CONTENT_UNSUPPORTED_BY_BROWSER` error on other browsers due to
114-
their lack of TS support.
115-
116-
You can enable transmuxing by [including mux.js][] v5.6.3+ in your application.
117-
If Shaka Player detects that mux.js has been loaded, we will use it to transmux
118-
TS content into MP4 on-the-fly, so that the content can be played by the
119-
browser.
120-
121-
<hr>
122-
123109
**Q:** Why does it take so long to switch to HD?
124110

125111
**A:** When Shaka Player's `AbrManager` makes a decision to adapt, we don't

externs/mux.js

Lines changed: 0 additions & 69 deletions
This file was deleted.

karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,6 @@ module.exports = (config) => {
191191
// Babel polyfill, required for async/await
192192
'node_modules/@babel/polyfill/dist/polyfill.js',
193193

194-
// muxjs module next
195-
'node_modules/mux.js/dist/mux.min.js',
196-
197194
// codem-isoboxer module next
198195
'node_modules/codem-isoboxer/dist/iso_boxer.min.js',
199196

@@ -247,6 +244,9 @@ module.exports = (config) => {
247244
{pattern: 'test/test/assets/hls-ts-h264/*', included: false},
248245
{pattern: 'test/test/assets/hls-ts-mp3/*', included: false},
249246
{pattern: 'test/test/assets/hls-ts-muxed-aac-h264/*', included: false},
247+
{pattern: 'test/test/assets/hls-ts-muxed-ac3-h264/*', included: false},
248+
{pattern: 'test/test/assets/hls-ts-muxed-mp3-h264/*', included: false},
249+
{pattern: 'test/test/assets/hls-ts-muxed-ec3-h264/*', included: false},
250250
{pattern: 'dist/shaka-player.ui.js', included: false},
251251
{pattern: 'dist/locales.js', included: false},
252252
{pattern: 'demo/**/*.js', included: false},

lib/dependencies/all.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
goog.provide('shaka.dependencies');
88

9+
goog.require('shaka.Deprecate');
10+
911
/**
1012
* @export
1113
*/
@@ -22,6 +24,12 @@ shaka.dependencies = class {
2224
if (!shaka.dependencies.Allowed[key]) {
2325
throw new Error(`${key} is not supported`);
2426
}
27+
if (key == shaka.dependencies.Allowed.muxjs) {
28+
shaka.Deprecate.deprecateFeature(5,
29+
'mux.js',
30+
'mux.js is no longer used in Shaka Player.');
31+
return;
32+
}
2533
shaka.dependencies.dependencies_.set(key, () => dep);
2634
}
2735

@@ -36,12 +44,6 @@ shaka.dependencies = class {
3644
return shaka.dependencies.dependencies_.has(key);
3745
}
3846

39-
/** @return {?muxjs} */
40-
static muxjs() {
41-
return /** @type {?muxjs} */ (shaka.dependencies.dependencies_.get(
42-
shaka.dependencies.Allowed.muxjs)());
43-
}
44-
4547
/** @return {?ISOBoxer} */
4648
static isoBoxer() {
4749
return /** @type {?ISOBoxer} */ (shaka.dependencies.dependencies_.get(
@@ -65,6 +67,5 @@ shaka.dependencies.Allowed = {
6567
* @private {!Map.<shaka.dependencies.Allowed, function():?>}
6668
*/
6769
shaka.dependencies.dependencies_ = new Map([
68-
[shaka.dependencies.Allowed.muxjs, () => window.muxjs],
6970
[shaka.dependencies.Allowed.ISOBoxer, () => window.ISOBoxer],
7071
]);

0 commit comments

Comments
 (0)