shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
238 stars 63 forks source link

How to get error code from errorCallback #53

Closed Megubit closed 5 years ago

Megubit commented 5 years ago

I'm trying to setup error handling for the player with errorCallback, on the following way (playing some broken url):

_player = [[ShakaPlayerView alloc] init];
_player.errorCallback = ^(NSString *errorMessage, NSString *errorContext) {
         NSLog(@"ERROR MSG: %@ - %@", errorMessage, errorContext);
 };

The response that it returns is: ERROR MSG: Shaka Error NETWORK.BAD_HTTP_STATUS (https://dash.akamaized.net/dash264/TestCases/1c/q,404,,[object Object],0) - Error loading asset

However I'd like to only use the code BAD_HTTP_STATUS , BAD_ENCODING, etc...

Is there a method to get this, or is the only way to slice the error message. I didn't find anything specific in the documentation.

TheModMaker commented 5 years ago

There is no way currently, but I'm going to change to expose the Error type to Objective-C and use that instead.