shaka-project / shaka-player-embedded

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

How to play the mpd file placed in the iOS application? #153

Open yukihiro-m-play opened 4 years ago

yukihiro-m-play commented 4 years ago

I tried to play a clear mpd file in document directory of the ios application, but the following error occurred.

Error Message:

Shaka Error NETWORK.UNSUPPORTED_SCHEME (file:/var/mobile/Containers/Data/Application/C12A0B32-5742-40C2-8FE8-D7370F53F446/Documents/test.mpd):

Code:

NSString* documentsPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
NSString* localfile = [documentsPath stringByAppendingPathComponent:@"test.mpd"];
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:localfile];
if ( ! fileExists) {
    NSLog(@"not exist local file");
    return;
}
self.assetURI = [NSString stringWithFormat:@"file://%@",localfile];

[self.player load:self.assetURI withStartTime:startTime andBlock:^(ShakaPlayerError *error){
    if (error) {
        [self.errorDisplayView applyError:[error message]];
    } else {
        [self.player play];
    }
}];

How to play the mpd file placed in the iOS application?

TheModMaker commented 4 years ago

We don't support local playback of files. But that is probably something we can add.

yukihiro-m-play commented 4 years ago

Thank you for your answer. I understand that it is possible to add local playback features. When do you add local playback features? If possible, I would like you to add it in September.

TheModMaker commented 4 years ago

I'm the only one working on this project and I'm working on other things too; so it is really hard to say when features will be added. But I think this will be fairly easy, so I could probably get it done in Q3.