iosobjective-ctizensamsung-smart-tvsmartview

iOS Samsung SmartView SDK/ Tizen - How to tell when VideoPlayer 'playContent' has played successfully


I am successfully launching media using the SmartView SDK by using the following LoC:

[vp playContent:url title:title thumbnailURL:tURL completionHandler:^(NSError *_Nullable err) {
    NSLog(@"Value of err is: %@", err); //Result - 'Value of err is: is (null)'
}];

I'm wondering how can I get more information inside the completionHandler to tell me when the media has had success/ failure in playing.

I have tried to create an NSNotificationCenter observer inside the completionHandler and then I post notifications inside the onBufferingStart, onBufferingComplete methods.

I get the notifications, but this is outside of the [vp playContent:url title:title thumbnailURL:tURL completionHandler: block.

Does anyone see any problems with my method, or how would it be possible to get the following output:

[vp playContent:url title:title thumbnailURL:tURL completionHandler:^(NSError *_Nullable err) {
    //get a success
    //    AND
    //get a failure
}];

I assume that I should believe it is always successful until I get an err, so:

if (err){
    //fail
} else {
    //success
}

A follow up question:

Has anyone else who has used this SDK, noticed that the playContent method gets executed twice?


Solution

  • This issue appears to have been fixed in the newest version of the SmartView framework.

    It's also worth noting that it's safe to assume that the completion handler always returns a success while there is no err being returned.