Insert an audio or video file into the active document

In Blend for Visual Studio 2012, you can drag supported audio or video files onto the artboard from outside Blend, or use the Insert feature of the Projects panel. Audio and video files are added to the artboard wrapped in a MediaElement control, complete with a timeline. To use the Insert feature, the file must be one of the supported types listed in Inserting audio and video.

[!참고]

To work with media files in Blend, you must have Windows Media Player 10 installed on your computer. You can download Windows Media Player 10 from the Windows Media website.

To add an audio or video file to a project

  • Do one of the following:

    • On the Project menu, click Add Existing Item. Browse to the location of the audio or video file that you want to add to the current project, and then click Open.

    • Drag the file from a folder in File Explorer or from your desktop into the Projects panel.

The media file appears in the Projects panel, from which you can insert it into the active object in the open document.

To insert an audio or video file into the active document

  1. Do one of the following:

    • In the Projects panel, double-click an audio or video file, or right-click an audio or video file, and then click Insert. Or, if you want to add the media file as a child object in another object in the document, click that object in the Objects and Timeline panel to make it the active object, and then insert the audio or video file.

    • Drag an audio or video file from the Projects panel onto the artboard.

    • Drag an audio or video file from a folder in File Explorer or from your desktop onto the artboard.

    If a timeline is selected before insertion, the media file will be inserted into that timeline, and the media file will be scheduled to start at the current playhead location. For example, if the playhead is at time=5.0s on the OnLoaded tab when the media file is inserted, the media file will not start to play until 5 seconds after the document has been loaded at run time.

    If no timeline is selected, a new media timeline is created, and the media file is added to the new timeline at time=0s.

  2. You can now configure media-specific properties, and you can modify the media element timeline just as you would modify an animation timeline. For more information, see the topics listed in Animating objects.

    팁

    A media file is displayed on the timeline as a blue bar representing the duration of playing time. You can view the blue bar by expanding the inserted audio or video in the objects view in the Objects and Timeline panel.

참고 항목

작업

Control media using triggers in a timeline

Customize an Expression Encoder template for Silverlight