Closed OmarPedraza closed 4 years ago
The MediaPlayer
error could probably be ignored, but I'm not really sure why that is happening. Can you look at the Shaka Player demo assets and try one of the Widevine assets? Can you also set the GLOG_v=1
environment variable and see what you get? When playing content, you're getting a network error, right? It appears you are getting a CURLE_RECV_ERROR error about receiving data from the server. Are you adding a ShakaPlayerClient
, and are you getting onPlayer:error:
calls?
Hi @TheModMaker,
I've been doing some new tests with GLOG_v=1
environment variable set.
First of all, I've had the same result for offline storage by doing the following test:
self.storage?.configure("drm.servers.\(Constants.Downloads.widevineServerName)", with: "https://cwip-shaka-proxy.appspot.com/no_auth")
self.storage?.store("https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine/dash.mpd") { (content, failure) in
print(failure)
}
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0619 12:56:53.547833 1866674176 js_engine.cc:33] Begin GC run
I0619 12:56:53.558997 1866674176 object_tracker.cc:143] Deleted 830 object(s).
I0619 12:56:53.561655 1866674176 js_engine.cc:44] End GC run
E0619 12:56:54.158365 1866674176 media_source.cc:97] Unable to find a MediaPlayer instance to query
...
E0619 12:56:54.171846 1866674176 media_source.cc:97] Unable to find a MediaPlayer instance to query
I0619 12:56:54.171926 1866674176 search_registry.cc:207] None of the video capabilities are supported
Optional(Error Domain=ShakaPlayerErrorDomain Code=6001 "Shaka Error DRM.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE ()" UserInfo={NSLocalizedDescription=Shaka Error DRM.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE (), ShakaPlayerErrorSeverityKey=2, ShakaPlayerErrorCategoryKey=6})
I0619 12:57:23.546689 1866674176 js_engine.cc:33] Begin GC run
I0619 12:57:23.566701 1866674176 object_tracker.cc:143] Deleted 269 object(s).
I0619 12:57:23.569460 1866674176 js_engine.cc:44] End GC run
Nevertheless, I've added a ShakaPlayerClient
and made a test for online playback using the same demo asset as you can see here:
// Make a Shaka Player with its corresponding view.
if let player = try? ShakaPlayer() {
player.client = self
player.configure("drm.servers.\(Constants.Downloads.widevineServerName)", with: "https://cwip-shaka-proxy.appspot.com/no_auth")
let playerView = ShakaPlayerView(player: player)
playerView.frame = self.view.bounds
self.view.addSubview(playerView)
// Load and play an asset.
player.load("https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine/dash.mpd") {
if let error = $0 {
print("Error loading manifest: \(error.message)")
} else {
player.play()
}
}
}
extension ShowHeaderController: ShakaPlayerClient {
func onPlayer(_ player: ShakaPlayer, error: ShakaPlayerError) {
print("error: \(error)")
}
}
And it worked correctly. Is that demo asset not ready for persistent storage?
After these results, it seems like something is wrong with our server, but it was working with the previous version of Widevine. What has to be changed? Any other idea?
Thanks @TheModMaker!
What's happening is when we query EME for support, we need to check which codecs are supported. To do this, we need a MediaPlayer
instance to query. Normally, one exists while playing and we can just pick one. But if you are storing something, you don't need a MediaPlayer
to be alive.
A workaround is to create a ShakaPlayer
instance, which should create the default MediaPlayer
instance. But we should fix this to work even without any ShakaPlayer
objects alive.
As for the network error, it make be a red herring. It may be caused by us aborting the request when the codec error happens. If you create a ShakaPlayer
instance first, does the error still appear?
Hi @TheModMaker, Thanks for you help!
After creating a persistent instance of ShakaPlayer
(very important, it has to be persistent during ShakaPlayerStorage
lifecycle) it started downloading the asset. Nevertheless, we're eager to see the fix for downloading without the need of a player instance.
We're now facing a problem with license download, but that's another story 😅
Hi there, We're working on updating our current Widevine CDM 14.4.1 for offline playback to newer Widevine CDM 15.2.3, and, as you know, that implies to use your Shaka Player Embedded SDK.
First of all, we've used the following commands for embedding Widevine into Shaka Player:
For debugging in simulator:
For debugging in devices:
For release version:
After running those commands, we joined both debug frameworks using
lipo
into one containing all needed architectures.Finally we embedded
ShakaPlayerEmbedded.FFmpeg.framework
,ShakaPlayerEmbedded.framework
andwidevine_cdm_secured_ios.framework
in our project's target.Nevertheless, when trying to start downloading an asset, I'm receiving the following error:
This error should appear when DRM is not supported and, even reading as much documentation and issues as I found, I've not been able to fix it.
This is the code I've using right now:
self.storage
is an instance ofShakaPlayerStorage
initialized in the following way:being
Constants.Downloads.widevineServerName
equal to"com\\.widevine\\.alpha"
.Regarding DRM server, I've tried several things for it: use just our Widevine license server URL, add all parameters you can see in the code, refresh MPX token,... but nothing worked.
This is the whole log I'm receiving in the app:
It seems like the SDK is not able to find
MediaPlayer
from Widevine CDM SDK, have we done anything wrong while integrating it?But if that's the problem, there's something that we don't understand.
We tried to play the same content online just for seeing if problem is related to offline storage and with the following code:
Which uses the same configuration for DRM server and asset (offline flag is for returning a MPD instead of the M3U8 format we're using for online playback), the error we're receiving is not the same, as you can see here:
We're sure we're missing something or we did something wrong but what? Can you help us?
Thanks!