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

Add certificate field to custom asset section in demo app #1135

Closed
chrisfillmore opened this issue Nov 17, 2017 · 3 comments
Closed

Add certificate field to custom asset section in demo app #1135

chrisfillmore opened this issue Nov 17, 2017 · 3 comments
Labels
flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@chrisfillmore
Copy link
Contributor

The demo app should include a 'Certificate URL' field in the custom asset section. This would be helpful for testing:

  • Fairplay content
  • Widevine content where the license server isn't configured to handle certificate requests

I can make a PR for this.

@chrisfillmore
Copy link
Contributor Author

chrisfillmore commented Nov 17, 2017

I'm having a compiler issue. Here is the offending function:

/**
 * @param {!string} uri
 * @return {!Promise}
 * @private
 */
shakaDemo.requestCertificate_ = function(uri) {
  var netEngine = shakaDemo.player_.getNetworkingEngine();
  var requestType = shaka.net.NetworkingEngine.RequestType.APP;
  var uris = /** @type {!Array.<string>} */ ([uri]);
  var request = shaka.net.NetworkingEngine.makeRequest(uris);

  return netEngine.request(requestType, request).then(function(response) {
    return response.data;
  });
};

This is the message I get from the compiler:

[INFO] Compiling the demo app (debug)...
/Users/chrisf/Documents/github_forks/shaka-player/demo/asset_section.js:143: ERROR - Property makeRequest never defined on shaka.net.NetworkingEngine
  var request = shaka.net.NetworkingEngine.makeRequest(uris);
                                           ^^^^^^^^^^^

I thought maybe it was the args I was passing to makeRequest, so I've tried all of the following:
var request = shaka.net.NetworkingEngine.makeRequest([uri]);
var request = shaka.net.NetworkingEngine.makeRequest(uris);
var request = shaka.net.NetworkingEngine.makeRequest(uris, null);
var request = shaka.net.NetworkingEngine.makeRequest(uris, shaka.net.NetworkingEngine.defaultRetryParameters);

I'm not sure what to do. Also, is the type annotation necessary below?

var uris = /** @type {!Array.<string>} */ ([uri]);

Thanks for the help.

@TheModMaker TheModMaker added type: enhancement New feature or request flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this and removed needs triage labels Nov 17, 2017
@TheModMaker TheModMaker added this to the Backlog milestone Nov 17, 2017
@TheModMaker
Copy link
Contributor

It looks like makeRequest isn't exported, so the demo can't access it. You can either add @export to the method or you can create a Request object manually and just not include the fields you don't need. NetworkingEngine will fill any missing fields with defaults.

var request = /** @type {shakaExtern.Request} */ ({uris: [uri]});

That cast is needed since it has missing fields. But the cast for Array.<string> shouldn't be needed.

@chrisfillmore
Copy link
Contributor Author

Thanks @TheModMaker, I've submitted a PR.

@joeyparrish joeyparrish modified the milestones: Backlog, v2.3.0 Nov 20, 2017
@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
flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants