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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...