Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLS AES-128 streams fail to play in MS Edge and when casting #4441

Closed
multiplexer2 opened this issue Aug 25, 2022 · 8 comments
Closed

HLS AES-128 streams fail to play in MS Edge and when casting #4441

multiplexer2 opened this issue Aug 25, 2022 · 8 comments
Assignees
Labels
component: HLS The issue involves Apple's HLS manifest format priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@multiplexer2
Copy link

Have you read the FAQ and checked for duplicate open issues?
Yes

What version of Shaka Player are you using?
4.2 nightly

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from main?
Have not tried

Are you using the demo app or your own custom app?
The Shaka demo app

If custom app, can you reproduce the issue using our demo app?
Yes

What browser and OS are you using?
Microsoft Edge
Chromecast from Google Chrome on Windows and Ubuntu

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
N/A

What are the manifest and license server URIs?
I've been testing with "Art of Motion (HLS, TS, AES-128)" on the Shaka demo page

What configuration are you using? What is the output of player.getConfiguration()?
The config is as configured on the demo page

What did you do?
Test 1: Navigate to the stream in MS Edge and start playback
Test 2: Navigate to the stream in Chrome and start casting

What did you expect to happen?
The video to play without issues

What actually happened?
In both cases, the video starts playing but after a couple of seconds playback stops with the following error:

Failed to set the 'timestampOffset' property on 'SourceBuffer': The timestamp offset may not be set while the SourceBuffer's append state is 'PARSING_MEDIA_SEGMENT'.
    at shaka.media.MediaSourceEngine.appendBuffer (https://nightly-dot-shaka-player-demo.appspot.com/lib/media/media_source_engine.js:630:38)
    at async shaka.media.StreamingEngine.append_ (https://nightly-dot-shaka-player-demo.appspot.com/lib/media/streaming_engine.js:1646:5)
    at async shaka.media.StreamingEngine.fetchAndAppend_ (https://nightly-dot-shaka-player-demo.appspot.com/lib/media/streaming_engine.js:1301:9)

@multiplexer2 multiplexer2 added the type: bug Something isn't working correctly label Aug 25, 2022
@github-actions github-actions bot added this to the v4.3 milestone Aug 25, 2022
@avelad
Copy link
Member

avelad commented Aug 25, 2022

image
https://shaka-player-demo.appspot.com/demo/#audiolang=es;textlang=es;uilang=es;asset=https://storage.googleapis.com/shaka-demo-assets/sintel-ts-aes-key-rotation/master.m3u8;panel=ALL_CONTENT;build=uncompiled

I was able to reproduce it in Edge. There must be some bug in the AES-128 implementation. @theodab you have implemented it, can you take a look at it?

@avelad avelad added component: HLS The issue involves Apple's HLS manifest format priority: P1 Big impact or workaround impractical; resolve before feature release labels Aug 25, 2022
@shrkwt
Copy link

shrkwt commented Aug 29, 2022

MS Edge has native transmuxing of mpeg-2-ts chunks of hls streams.
So to counter it.
First of all, make sure you have this included

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mux.js"></script>

in the head of your app or project.

...

And also make sure you have

player.configure("streaming.forceTransmuxTS", true);

inside your init function.
I.e.

async function init() { player.configure("streaming.forceTransmuxTS", true); }

Make sure to report this error to MS so you don't have to include this all in future.

@shrkwt
Copy link

shrkwt commented Aug 29, 2022

This was how I fixed it as I also use MS edge.

https://www.speedynet.eu.org/shaka?link=<YOUR_MANIFEST_URL>

This is a quick way of testing HLS streams on Edge with Shaka player.

@martinstark
Copy link
Contributor

martinstark commented Aug 29, 2022

We just pushed Shaka 4.2.0 to production and started seeing this issue in MS Edge.

Failed to set the 'timestampOffset' property on 'SourceBuffer': The timestamp offset may not be set while the SourceBuffer's append state is 'PARSING_MEDIA_SEGMENT'

We'll test the player.configure("streaming.forceTransmuxTS", true); fix.

@joeyparrish
Copy link
Member

I would guess that errors relating to timestampOffset may not have anything to do with encryption.

I'm confused by some of the posts. The OP says the issue starts when casting, but others are suggesting fixes that relate to Edge playback rather than Chromecast playback.

Does the issue occur only when casting? Or does the issue occur when playing directly in Edge?

Does the issue occur when casting from other browsers, such as Chrome?

@multiplexer2
Copy link
Author

Does the issue occur only when casting? Or does the issue occur when playing directly in Edge?

Both. The problem occurs with direct playback from Edge - and also when initiating a cast session from any browser, including Edge. When I add the forceTransmuxTS workaround to the player setup in Edge, direct playback works fine. But when attempting to cast the player throws that same error message:


CastSender: onSessionInitiated
CastSender: connection status true
Starting unload...
CastSender: connection status true
Error code 11 object Error: Failed to set the 'timestampOffset' property on 'SourceBuffer': The timestamp offset may not be set while the SourceBuffer's append state is 'PARSING_MEDIA_SEGMENT'.

Does the issue occur when casting from other browsers, such as Chrome?

Yes.

@avelad
Copy link
Member

avelad commented Oct 6, 2022

@theodab can you review this issue? Thanks!

@theodab
Copy link
Contributor

theodab commented Oct 11, 2022

I tried this out in MS Edge and didn't see the error. I un-applied #4543 (which looks like it is describing the same issue) and tried again and did see the error, so I think this is fixed now.
If you see that error again, you can re-open this.

@theodab theodab closed this as completed Oct 11, 2022
@theodab theodab assigned JulianDomingo and unassigned theodab Oct 11, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Dec 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: HLS The issue involves Apple's HLS manifest format priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

7 participants