Radu Paul Posted November 23, 2021 Share Posted November 23, 2021 Hi, Can someone explain to me why we need Task.Delay(3000)? Thanks Link to comment Share on other sites More sharing options...
0 Yash Posted November 24, 2021 Share Posted November 24, 2021 Hi Radu Hope you are fine. I did not understand, can you please provide more details about your issue? Regards, Yash Link to comment Share on other sites More sharing options...
0 Radu Paul Posted November 25, 2021 Author Share Posted November 25, 2021 Sorry my bad I did not explained it properlly. So I am implementing AntMedia in a xamarin forms project and instead calling AntFrame.Start() at push of a button I want this method to be called OnAppearing() like this: protected override async void OnAppearing() { base.OnAppearing(); await StartStopAndMediaPlayer(); } protected override async void OnDisappearing() { base.OnDisappearing(); await StartStopAndMediaPlayer(); } protected async Task StartStopAndMediaPlayer() { if (AntFrame.IsPlaying || AntFrame.IsPublishing) { AntFrame.Stop(); } else { await Task.Delay(3000); AntFrame.Start(); } } But if I don't put the Task.Delay() it will throw this error "The method or operation is not implemented". Do I need it because AntMedia is not initialized yet? Can this be avoid somehow? Thanks in advance! Link to comment Share on other sites More sharing options...
0 Tahir Posted November 26, 2021 Share Posted November 26, 2021 Hi, In javaScript it takes time to use getUserMedia and initialize properties, therefore you can't start immediately, however, I don't know how it is going on in Xamarin if it is different. Thanks Link to comment Share on other sites More sharing options...
Question
Radu Paul
Hi,
Link to comment
Share on other sites
Top Posters For This Question
2
1
1
Popular Days
Nov 23
1
Nov 24
1
Nov 25
1
Nov 26
1
Top Posters For This Question
Radu Paul 2 posts
Tahir 1 post
Yash 1 post
Popular Days
Nov 23 2021
1 post
Nov 24 2021
1 post
Nov 25 2021
1 post
Nov 26 2021
1 post
3 answers to this question
Recommended Posts