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

Support persistent licenses and offline in Shaka v2 #343

Closed
snehapvs opened this issue Apr 18, 2016 · 19 comments
Closed

Support persistent licenses and offline in Shaka v2 #343

snehapvs opened this issue Apr 18, 2016 · 19 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@snehapvs
Copy link

Found many related issues to this but most of them move around shaka.media.EmeManager
http://v1-6-2.shaka-player-demo.appspot.com/docs/shaka.media.EmeManager.html which is not found in current version of shaka player.
Was this function completely removed? If so what is the alternative to have persistent license/licenses stored in shaka player in current API

@tdrews tdrews added this to the v2+ milestone Apr 18, 2016
@tdrews tdrews added the type: enhancement New feature or request label Apr 18, 2016
@tdrews
Copy link
Contributor

tdrews commented Apr 18, 2016

Hi,

EmeManager has been replaced by DrmEngine in Shaka v2. However, we have not integrated offline support into Shaka v2 yet. We will support DRM configuration for persistent licenses through player.configure() (see DRM tutorial and Advanced DRM Configuration) and add new APIs for storing and loading.

@tdrews tdrews changed the title Persistent licenses in shaka player Support persistent licenses and offline in Shaka v2 Apr 18, 2016
@snehapvs
Copy link
Author

snehapvs commented Apr 19, 2016

Will the persistent license or storing license service be availed on chrome desktop ?

I tried using "persistentstaterequired" parameter in DRM config, in the basic tutorial available from documentation . below is what I have included in player.configure option :

player.configure({
      drm: {
        servers: {
          'com.widevine.alpha': 'url',
        },
        advanced: {
            'com.widevine.alpha': {
              'persistentStateRequired':true
            }
          }  
      }
    });

Even without persistentStateRequired, Having advanced in the drm config is giving exception(error 6001). Is it because it is not handled in the current player's version.

@tdrews
Copy link
Contributor

tdrews commented Apr 19, 2016

Desktop Chrome does not support persistent licenses at this time.

Error 6001 means the key system is not available for your content.
Does your MPD file specify Widevine protection?
If so, and you are on Windows, please check that "WidevineCdm" is listed at chrome://components.

@snehapvs
Copy link
Author

I am on ubuntu (chrome)..and yes it is widevine protected.
doesnt support persistent licenses means..not supported by widevine or not supported by shaka player?

@tdrews
Copy link
Contributor

tdrews commented Apr 20, 2016

Desktop Chrome does not support persistent licenses at this time.

Means Widevine on desktop Chrome does not support persistent licenses at this time.
Shaka v2 will eventually provide APIs to use persistent licenses.

Are you still having difficulties with player.configure()?
Are you able to play "Sintel 4K (multicodec, widevine)" from the demo page?
Are you able to play protected content if you use the default player configuration?

@snehapvs
Copy link
Author

I was able to play widevine encrypted videos with normal drm configuration on player.configure. as i said earlier, when trying to use advanced options, the video is not being played.

@tdrews
Copy link
Contributor

tdrews commented Apr 20, 2016

I'm having trouble reproducing the issue. What happens if you add

config.drm.advanced = {
  'com.widevine.alpha': {
    'persistentStateRequired': false
  }
};

right before https://github.com/google/shaka-player/blob/master/demo/asset_section.js#L150 ?

@snehapvs
Copy link
Author

snehapvs commented Apr 20, 2016

Following is the part of code I tried. No error on Windows but giving error on Linux on chrome browser in both cases.
function initPlayer() { var video = document.getElementById('video'); var player = new shaka.Player(video); window.player = player; alert("trueee"); player.configure({ drm: { servers: { 'com.widevine.alpha': 'license server url', }, advanced: { 'com.widevine.alpha': { 'persistentStateRequired':true } } } }); player.load(manifestUri).then(function() { }) } document.addEventListener('DOMContentLoaded', initApp);

@tdrews tdrews self-assigned this Apr 20, 2016
@tdrews
Copy link
Contributor

tdrews commented Apr 20, 2016

The following works for me on Chrome Linux 50.0.2661.75 and Chrome Linux 51.0.2704.7 with or without "advanced" settings using the master branch.

app.html:

<!DOCTYPE html>
<html>
  <head>
    <script src="shaka/third_party/closure/goog/base.js"></script>
    <script src="shaka/dist/deps.js"></script>
    <script src="shaka/shaka-player.uncompiled.js"></script>
    <script src="app.js"></script>
  </head>
  <body>
    <video id="video" width="640" controls autoplay></video>
  </body>
</html>

app.js:

var manifestUri = '//storage.googleapis.com/shaka-demo-assets/sintel-widevine/dash.mpd';

function initApp() {
  shaka.polyfill.installAll();
  shaka.Player.support().then(function(support) {
    if (support.supported) {
      initPlayer();
    } else {
      alert('Browser not supported!');
    }
  });
}

function initPlayer() {
  shaka.log.setLevel(shaka.log.Level.V1);

  var video = document.getElementById('video');
  var player = new shaka.Player(video);

  window.player = player;
  player.addEventListener('error', onErrorEvent);    

  player.configure({
    drm: {
      servers: { 'com.widevine.alpha': '//widevine-proxy.appspot.com/proxy' },
      advanced: {
        'com.widevine.alpha': {
          'persistentStateRequired': true
        }
      }
    }
  });

  player.load(manifestUri).then(function() {
    console.info('Manifest loaded!');
  }).catch(onError);
}

function onErrorEvent(event) { onError(event.detail); }
function onError(error) { console.error(error); }

document.addEventListener('DOMContentLoaded', initApp);

Does this work? If not, which version of Chrome are you using? What does shaka/support.html say? What log messages do you get in the console after trying the above?

@snehapvs
Copy link
Author

Let me try it and before that what do you conclude on persistent license on chrome desktop? Can we expect it in near time?

@tdrews
Copy link
Contributor

tdrews commented Apr 20, 2016

Persistent licenses on desktop Chrome is a desirable feature; however, I can't give you any expectations of when it would be implemented.

@snehapvs
Copy link
Author

snehapvs commented Apr 21, 2016

Hello the above code is working on Linux (ubuntu) as well.However If I can't get a persistent license on chrome Desktop, I doesn’t need persistent parameter there. Thanks

@tdrews
Copy link
Contributor

tdrews commented Apr 21, 2016

Good to hear that that code works. I'll leave this issue open to track progress for offline support.

@tdrews tdrews removed their assignment Apr 21, 2016
@joeyparrish joeyparrish modified the milestones: v2.0.0, v2+ Apr 27, 2016
@soualid
Copy link

soualid commented Apr 29, 2016

Sorry but after reading this thread, I am not sure to understand : does the offline support for Widevine is actually implemented on Chrome Desktop ? Is it implemented in Shaka Player version 1.6 ? Is it for Shaka Player version 2.0 ?

Many thanks in advance for clarifying this.

@tdrews
Copy link
Contributor

tdrews commented Apr 29, 2016

  • Widevine on desktop Chrome does not support persistent licenses, specifically it does not support persistent-usage-record or persistent-license MediaKeySessionTypes.
  • Shaka v2 does not provide offline support yet (i.e., APIs to use persistent licenses and to store/load content).
  • Shaka v1 does provide offline support.

We will implement offline support in Shaka v2, but keep in mind that offline support (as defined above) is implemented at the JavaScript level; it is separate from persistent license support, which is implemented at the browser/key-system level.

@soualid
Copy link

soualid commented Apr 29, 2016

Many thanks. If I understand well and for now, no DRM vendor support persistent license for offline usage on desktop through EME.

And this has, of course, nothing to do with Shaka player. Thank you again for clarifying this.

@joeyparrish
Copy link
Member

Widevine currently supports persistent licenses on ChromeOS.

This is the bug to track Widevine persistent license support on Chrome for Android: https://bugs.chromium.org/p/chromium/issues/detail?id=493521

The great thing about JavaScript running on top of standard APIs is that if and when a DRM vendor supports persistent licenses on desktop through EME, a Shaka-based application will have access to that capability without any changes.

shaka-bot pushed a commit that referenced this issue May 20, 2016
This is part of the v2 equivalent of the ContentDatabase.  This only
manages low-level interactions with the IndexedDB and wraps all
actions in Promises.

This also adds an in-memory version that is used for testing.

Issue #343

Change-Id: I0d296639e74c1d4cab232ce7248b03a353b38b3c
shaka-bot pushed a commit that referenced this issue Jun 9, 2016
This contains two major parts: the Storage class, which manages
storing, listing, and deleting the stored content, and the offline
manifest parser, which loads the stored content into a manifest so the
Player can play it.

This does not include support for storing encrypted content.  The
EME sessions will not be stored properly and will fail to play.

Issue #343

Change-Id: I7ecb3400391ec8100155aa972f9b09bb7ae24d9d
shaka-bot pushed a commit that referenced this issue Jun 10, 2016
Issue #343

Change-Id: I66d2b57f6d7db8b0666916f951ba434337fac43a
shaka-bot pushed a commit that referenced this issue Jun 10, 2016
Issue #343

Change-Id: I8c2ff4b2dd1777f28b1dd427527c83576ca8fcbc
@chetanshelake
Copy link

Hello friend,
Shaka player repository is a great repository for html5 player. I have integrate shaka player in my website and it work fine.
I have some issues with that -

  1. I am unable to display buffer progress bar.
  2. confused about
    • if video played to some duration like 1 or 2 min and i try to start from first then it start again buffering but this content already buffered from server.
      How can i avoid re-streaming for each video?
      I have search much more related that but i can't found any solution
      if any one have solution related that please help me

Thank & regards
chetan shelake

@joeyparrish
Copy link
Member

@chetanshelake, thanks for your interest in Shaka Player. Your comments are unrelated to this issue. Please file a new issue or write to our mailing list for support.

@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants