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

PlayReady protected MSS fails in nightly demo on Edge #5390

Closed
unext-wendong opened this issue Jul 3, 2023 · 8 comments · Fixed by #5486
Closed

PlayReady protected MSS fails in nightly demo on Edge #5390

unext-wendong opened this issue Jul 3, 2023 · 8 comments · Fixed by #5486
Assignees
Labels
component: MSS The issue involves Microsoft Smooth Streaming manifest format component: PlayReady The issue involves the PlayReady DRM flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@unext-wendong
Copy link

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

What link can we use to reproduce this?
https://nightly-dot-shaka-player-demo.appspot.com/demo/#audiolang=en-US;textlang=en-US;uilang=en-US;panel=CUSTOM%20CONTENT;build=uncompiled

What version of Shaka Player are you using?
v4.3.7-main-35-g6c71b0ee6-uncompiled

What browser and OS are you using?
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67

What did you do?

  1. Goto the shaka-player-demo nightly-built version from here.
    https://index-dot-shaka-player-demo.appspot.com
  2. Create a custom content with the following info:
    Main->Manifest URL: https://playready.directtaps.net/smoothstreaming/SSWSS720H264PR/SuperSpeedway_720.ism/Manifest
    DRM->Custom License Server URL: https://playready.directtaps.net/pr/svc/rightsmanager.asmx
    Name: Smooth PlayReady Test
  3. Click "PLAY".

Content source:
https://github.com/androidx/media/blob/release-1.1.0/demos/main/src/main/assets/media.exolist.json#L264-L270

What did you expect to happen?
The stream starts playing.

What actually happened?
Playback didn't start and the following error message showed up:

Error code 3016

(No relevant error logs in the console)

Additional info
My environment:
Browser: Edge, Version 114.0.1823.67 (Official build) (64-bit)
OS: Windows 11 Pro, 22H2

The unprotected version of the same content works fine:
https://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest

@unext-wendong unext-wendong added the type: bug Something isn't working correctly label Jul 3, 2023
@avelad avelad added priority: P2 Smaller impact or easy workaround component: PlayReady The issue involves the PlayReady DRM component: MSS The issue involves Microsoft Smooth Streaming manifest format labels Jul 3, 2023
@avelad avelad added this to the v4.4 milestone Jul 3, 2023
@avelad
Copy link
Collaborator

avelad commented Jul 3, 2023

@unext-wendong are you interested on send a PR to fix it? The issue could be in https://github.com/shaka-project/shaka-player/blob/main/lib/transmuxer/mss_transmuxer.js#L228

@unext-wendong
Copy link
Author

@avelad Ah, I see. But sorry I don't really have time to work on it this week.

If no one takes it, I can take a look later.

@avelad avelad added the flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this label Jul 4, 2023
@avelad
Copy link
Collaborator

avelad commented Jul 4, 2023

@unext-wendong I'm not going to be able to work on this in the next few months, I'm assigning the issue to you so you can create a PR.

@unext-wendong
Copy link
Author

@avelad Will see if I can figure it out.

Btw, have we ever tried the PlayReady protected MSS playback?
It seems odd that the widely used sample content from Microsoft doesn't work.

@joeyparrish
Copy link
Member

MSS support is very recent and incomplete. It is possible that @avelad did not fully implement it.

@unext-wendong
Copy link
Author

@avelad @joeyparrish I think I got it working now.

There were mainly 2 issues:

  1. The KID in the WRMHEADER is a GUID structure serialized in little-endian, and we were reading as a normal byte array.
  2. The sepiff box doesn't exist AFAIK. In PIFF, the sample encryption info could be stored either in a senc box or a uuid box with user type "A2394F52-5A9B-4F14-A244-6C427C648DF4".

The playback works now with the following changes:
https://github.com/shaka-project/shaka-player/compare/main...unext-wendong:shaka-player:bugfix/protected-mss?expand=1

However, I left a TODO here, where I couldn't get isoFile.fetchAll() compile. Not sure where I got it wrong.
https://github.com/unext-wendong/shaka-player/blob/bugfix/protected-mss/lib/transmuxer/mss_transmuxer.js#L275-L276

Could you guys take over from here? I don't have CLA signed so couldn't merge it anyway.

You can use my above change as you want. I have little experience writing JS code, so you might want to rewrite it.

@joeyparrish
Copy link
Member

The CLA is a copyright assignment. According to Google's policy, if you haven't signed a CLA, I couldn't just take your code and merge it as if it were my own. (I am not a lawyer, and I am only speaking about company policy and not open source licensing under the law.)

@unext-wendong
Copy link
Author

One update:

  • Removed the creation of the saio and saiz boxes, which to my understanding is only an alternative to the presence of the senc box.
  • The code got much simpler and is able to handle moof boxes with multiple uuid boxes.

btw: My CLA process is still on pending.

unext-wendong added a commit to unext-wendong/shaka-player that referenced this issue Jul 24, 2023
unext-wendong added a commit to unext-wendong/shaka-player that referenced this issue Jul 24, 2023
unext-wendong added a commit to unext-wendong/shaka-player that referenced this issue Jul 25, 2023
unext-wendong added a commit to unext-wendong/shaka-player that referenced this issue Jul 25, 2023
unext-wendong added a commit to unext-wendong/shaka-player that referenced this issue Jul 25, 2023
joeyparrish pushed a commit that referenced this issue Aug 17, 2023
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Oct 16, 2023
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Oct 16, 2023
Robloche pushed a commit to Robloche/shaka-player that referenced this issue Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: MSS The issue involves Microsoft Smooth Streaming manifest format component: PlayReady The issue involves the PlayReady DRM flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
4 participants