locked
App_MediaEnded Question

    Question

  • void MainPage::App_MediaEnded(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
    {
    OnStop();
    Stop Timer();
    GoPlayNext();
    }

    Here is my MediaEnded code. The problem is in GoPlayNext which is executed before current media is finally terminated. That may caused sync problem. Maybe GoPlayNext() need to be a async function. Unfortunately unlike C# there is no async keyword in C++. Any solution for this async problem?

    Monday, March 24, 2014 1:56 PM

All replies

  • Can you check the status of the player before moving on to play the next song?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, March 24, 2014 7:23 PM
    Moderator
  • OnStop sets the status of the player to stop. But App_MediaEnded does not close the media file at this moment. It is a kind of MediaPreEnd. There is no MediaPostEnd event. Nowhere to put GoPlayNext that will open a new song.
    Tuesday, March 25, 2014 9:16 AM