Languages

Menu
Sites
Language
MediaPlayer PrepareAsync Blocking

Hello,

I'm using API 4.0-5.0 on emulator TV 5.5,
When live stream list work, there is no problem; but if there are some problem ( example firewall blocking, or stream no working) we can't zap on another fastly,  beacause we are await prepareAsync, blocking too, when connection to url can't be etablished, and player status stay in preparing status, can't be unprepraed.
How can I cancel it, it doesn't accept a CancellationToken.

 

Thank you.

Responses

4 Replies
Tizen .NET
Hello
it doesn't accept a CancellationToken.
=> What does it mean? Even though you call CancellationTokenSource.Cancel, doesn't it work??
 
I can't exactly reproduce the situation in question so I've just confirmed that TaskCanceledException occurs by CancellationTokenSource.Cancel(true) during player preparation.
CancellationTokenSource source = new CancellationTokenSource();
CancellationToken token = source.Token;
try
{
    await player.PrepareAsync(token);
} catch (Exception ex)
{
	// Error handling (TaskCanceledException)
}
finally
{
	source.Dispose();
}
 
It would be helpful to understand the problem if you could share a simple sample code that reproduces the problem. (tizen.net@samsung.com)
Thanks.
Ali Demir

Hi,

I saw today, PrepareAsync(CancellationTokenSource) is avaible in API 6.0, not before.
 

Thanks

Ali Demir

Hi,

I saw today, PrepareAsync(CancellationTokenSource) is avaible in API 6.0, not before.
And its not work on Tizen 4.0, thats why I asking you, if there is another solution :) ?

Thank you.

Jeong-yoon Nam

Hello.

Unfortunately you cannot cancel asynchronous preparing with API 5.0 or lower.

CancellationToken is added to make it cancelable.