locked
Video playback RRS feed

  • Question

  • Hi there.

    I want to display a video from my game, opening it in the external video player of the OS. How do I do this? I've searched everywhere for a solution, but found nothing...

    /Chris

    Monday, April 7, 2014 12:05 PM

Answers

  • Wow, managed to solve it! After many, many hours :)

    auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
    auto task = create_task(folder->GetFileAsync("Assets\\Videos\\intro.wmv")); // backslashes are important!
    task.then([](Windows::Storage::StorageFile^ file)
    {
        Windows::System::Launcher::LaunchFileAsync(file);
    });

    Thursday, April 24, 2014 2:12 PM

All replies

  • Use the MediaplayerLauncher class

    http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.tasks.mediaplayerlauncher

    Monday, April 7, 2014 2:02 PM
  • Thanks, but it is Silverlight only.. my game is written in C++.. :(
    Tuesday, April 8, 2014 5:05 AM
  • Anybody?

    The file is a WMV, and the code is written in C/C++0x (WinRT) since it is a game.

    Thursday, April 24, 2014 12:35 PM
  • Wow, managed to solve it! After many, many hours :)

    auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
    auto task = create_task(folder->GetFileAsync("Assets\\Videos\\intro.wmv")); // backslashes are important!
    task.then([](Windows::Storage::StorageFile^ file)
    {
        Windows::System::Launcher::LaunchFileAsync(file);
    });

    Thursday, April 24, 2014 2:12 PM