Jump to content
  • 0

Task.Delay(3000)


Radu Paul
 Share

Question

  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

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

 Share

×
×
  • Create New...