locked
How to play my audio with Media Player

    Question

  • I am developing a metro app to play some audio files. But i cannot see how to open it in Media Player. how can i play them in Mefia Player? help.
    Sunday, March 11, 2012 9:21 AM

Answers

  • Hi,

    You can use Play To to enable users to easily stream audio, video, or images.

    Here is sample code.

    var ptm = Windows.Media.PlayTo.PlayToManager.getForCurrentView();
    ptm.addEventListener("sourcerequested", sourceRequestHandler, false);
    In order to use Windows Media Player as a target device, your computer must be connected to a private network. Please refer to the following steps.
    1. Start Windows Media Player.
    2. Expand the Stream menu and enable the Allow remote control of my Player... option. Leave Windows Media Player open; it must be running to be available as a Play To target.
    3. Open the Devices and Printers control panel. Click Add devices and printers. In the Add devices and printers wizard, in the Choose a device or printer to add to this PC window, locate the Digital media renderer for your PC. This is the Windows Media Player for your PC. Select it and click Next. When the wizard finishes, you will see your instance of Windows Media Player in the list of Multimedia Devices.

    Best wishes,


    Robin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, March 11, 2012 1:10 PM
    Moderator

All replies

  • Hi,

    You can use Play To to enable users to easily stream audio, video, or images.

    Here is sample code.

    var ptm = Windows.Media.PlayTo.PlayToManager.getForCurrentView();
    ptm.addEventListener("sourcerequested", sourceRequestHandler, false);
    In order to use Windows Media Player as a target device, your computer must be connected to a private network. Please refer to the following steps.
    1. Start Windows Media Player.
    2. Expand the Stream menu and enable the Allow remote control of my Player... option. Leave Windows Media Player open; it must be running to be available as a Play To target.
    3. Open the Devices and Printers control panel. Click Add devices and printers. In the Add devices and printers wizard, in the Choose a device or printer to add to this PC window, locate the Digital media renderer for your PC. This is the Windows Media Player for your PC. Select it and click Next. When the wizard finishes, you will see your instance of Windows Media Player in the list of Multimedia Devices.

    Best wishes,


    Robin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, March 11, 2012 1:10 PM
    Moderator
  • Thanks. I can play it with media player well.
    Thursday, March 15, 2012 1:48 PM