shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.06k stars 1.33k forks source link

Delete stored DRM content while offline, release licenses later when back online #1326

Closed odedhutzler closed 5 years ago

odedhutzler commented 6 years ago

hey, i wonder why you have to be connected (you issue a license request) when deleting protected content (you get an error and nothing is deleted) store 'angle one - ... widevine' go offline try to delete it.

below is a link to our own drm content we tried to delete (online) and got 500 from our servers.. we are checking what's wrong with our servers (though they were ok with the request when we stored the data)

Thanks!

What version of Shaka Player are you using?: 2.3.2 uncompiled

Can you reproduce the issue with our latest release version?: yes

Can you reproduce the issue with the latest code from master?: didn't check

Are you using the demo app or your own custom app?: demo app

What browser and OS are you using?: chrome on mac

What are the manifest and license server URIs?: https://shaka-player-demo.appspot.com/demo/#asset=https://cdnapisec.kaltura.com/p/2222401/sp/222240100/playManifest/entryId/1_f93tepsn/protocol/http/format/mpegdash/flavorIds/1_7cgwjy2a,1_xc3jlgr7,1_cn83nztu,1_pgoeohrs/a.mpd;license=https://udrm.kaltura.com/cenc/widevine/license?custom_data=eyJjYV9zeXN0ZW0iOiJPVlAiLCJ1c2VyX3Rva2VuIjoiZGpKOE1qSXlNalF3TVh4VHNNVzRJY1Z3eWtkVzliVkNjZmFhV3h1WC1nSjVvT2p1TGdxWkl6dnpIMDJGNkpVRlZSU2NyRS03b1l0dGw4MDRKbVhISVY3ZVdMQ0tLNnROT1JoSHpDS1F5N2duNUVXam5Gc0YyM2p0ZlE9PSIsImFjY291bnRfaWQiOjIyMjI0MDEsImNvbnRlbnRfaWQiOiIxX2Y5M3RlcHNuIiwiZmlsZXMiOiIxXzdjZ3dqeTJhLDFfeGMzamxncjcsMV9jbjgzbnp0dSwxX3Bnb2VvaHJzIn0%3D&signature=q8e0KRmDtcBn7AeCAu0iq74LGQ8%3D;lang=en-US;build=uncompiled

joeyparrish commented 6 years ago

Releasing an offline license may involve a license exchange with the server. We tell the CDM (through EME) that we want to remove a persistent license session, and the CDM may send us a license release message. If so, we have to send it to the server and get a response to give back to the CDM. Until that process is complete, the offline license sticks around.

odedhutzler commented 6 years ago

@joeyparrish, thanks. so i cannot delete it while i'm offline. Is it on the roadmap? maybe as part of the big change you are planing for the storage?

joeyparrish commented 6 years ago

The ideal behavior, I think, would be that you can always delete the content while offline. If the license still needs to be released, we should have some way of tracking licenses that need release and trying to release them once we are back online.

I'll mark this as an enhancement and rename it to that effect. Thanks!

odedhutzler commented 6 years ago

defiantly.. :)

cool! thanks.

vaage commented 6 years ago

@joeyparrish If I could chime in with an idea for when someone goes to implement this. It may be a good idea if license management is moved out of storage.

Right now we have a flag for whether or not the storage system needs to download a license and free a license. But if the app was to track this, it could just cache which licenses it needed to free next time it had a network connection. This level of control is not possible in storage.

It would also remove the need for storage to have logic about licenses at all. No need to make a request or free them. It just worries about the segments and manifests.

joeyparrish commented 6 years ago

In Shaka v1, we used to require applications to manage the list of stored contents itself. In the end, it seemed to be too big a burden on applications. Because of this experience, I would prefer not to push license management onto applications.

Ideally, we could manage license release internally without creating additional APIs for the application and without requiring apps to track these themselves. For streaming playback, we hide license management inside DrmEngine. I don't see why it should have to be different for offline.

Obviously, we will need to design this, and it will impact the storage system in some way. I've put this feature on the backlog for now, and we'll work out a design before we jump into implementation.

joeyparrish commented 5 years ago

Released in v2.5.0-beta2.