locked
Preventing auto-play of .WMV files on page load RRS feed

  • Question

  • Hello all,

    I am a WPF/E newbie, so please forgive me if this is a less than spectacular question.

    I am going through the quickstart guide and I like the functionality of being able to embed a .WMV file with the interactive controls.  Problem is I do not want the movie to automatically being playing when the page loads.  How do I prevent this from happening?

    I tried a couple of things in the code to call the javascript function which is supposed to stop the playback but I am not having any luck.

    Thanks for the time,

    Doug

    Wednesday, January 17, 2007 5:43 PM

Answers

  • The MediaElement has an "AutoPlay" attribute included in the December CTP. This was added too late so the documentation was not updated. Set AutoPlay to false and the video will not start until you call the Play method.

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Wednesday, January 17, 2007 6:26 PM
  • Not intellisense for javascript, but the "WPF/E" SDK includes a XSD file that VS can use to provide intelli-sense. Did you install the SDK?

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Wednesday, January 17, 2007 7:43 PM

All replies

  • The MediaElement has an "AutoPlay" attribute included in the December CTP. This was added too late so the documentation was not updated. Set AutoPlay to false and the video will not start until you call the Play method.

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Wednesday, January 17, 2007 6:26 PM
  • You can use the AutoPlay property on MediaElement for this.

    e.g. <MediaElement x:Name="video" Source="test.wmv" AutoPlay="False" />

    Wednesday, January 17, 2007 6:27 PM
  • Thank you gentleman, both, for taking the time to answer my question; (and even provide the code.)  I really appreciate it.

    I figured there was either some property in the xaml I was missing or something.  I enjoy what I have seen of the technology so far and am looking forward to the full release...with updated documentation!  :)

     

    Cheers,

    Doug

    Wednesday, January 17, 2007 7:01 PM
  • As a follow up question, is there a way I can get the intelli-sense functionality into my Visual Studio 2005 for WPF/e so that I would have been able to see the property if I looked through?

    Thanks!

    Wednesday, January 17, 2007 7:05 PM
  • Not intellisense for javascript, but the "WPF/E" SDK includes a XSD file that VS can use to provide intelli-sense. Did you install the SDK?

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Wednesday, January 17, 2007 7:43 PM
  • Yeah, I installed the SDK.  I found the XSD file in the program's directory.  I just got it installed.  Thank you again.

     

    Cheers.

    Wednesday, January 17, 2007 8:12 PM