45117

Windows Media Player ctlcontrols.play and url dont work

Question:

private void mediaPlayer_Enter() { string path = Path.GetFullPath(currentTrack.Text); System.Diagnostics.Debug.WriteLine(path); mediaPlayer.URL = path; mediaPlayer.Ctlcontrols.play(); }

This is the piece of code which is being called when the state of the media player turns to "media ended". I know that it does execute that line of code but it still doesnt play. It takes the item out of the listbox (which is the playlist) and loads it into the mediaPlayer but does not AUTOMATICALLY play the song. I have to press the button to start playing it - it has do play it stright away by itself. What am I doing wrong? Please help!

Answer1:

I believe this will autoplay your media: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd562405(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/dd562405(v=vs.85).aspx</a>

<blockquote>

If the AxWindowsMediaPlayer.settings.autoStart property is true, playback begins automatically whenever you set currentMedia.

</blockquote>

Recommend

  • Take image from video playing on windows media player in C#
  • BackgroundMediaPlayer set Uri source of Media library item
  • ResponseBuilder is not working when used with entity object
  • Is it possible to control programs with Javascript?
  • Firefox augments the content-type of XMLHttpRequest
  • Return to second to last URL in MVC (return View with previous filter conditions applied)?
  • ASP.NET windows authentication should always ask for credentials
  • C++ cout and enum representations
  • Google analytics measurement protocol session timeout and query time limits
  • Python/Javascript: WYSIWYG html editor - Handle large documents fast and/or design theory
  • Streaming screenshots over WebRTC as a video stream from iOS
  • Problems with toDataURL HTML5 other ways to get canvas data?
  • Find JSON nested nodes using multiple string values
  • HTML5 video only works in IE. The other browsers shows the black screen
  • Is there a package like bigmemory in R that can deal with large list objects?
  • How Get arguments value using inline assembly in C without Glibc?
  • Azure webjobs output logs indexing taking very long
  • Clear fused location provider's location for testing
  • How to make R's read_csv2() recognise the text characters properly
  • Implementation of State Monad
  • ADO and msqli connections very slow
  • Marklogic : Query response time is very high
  • Limiting recursion to certain level - Duplicate rows
  • azure media services - The request body is too large and exceeds the maximum permissible limit
  • How do I pass the string value parameter of the selected list item from an auto-populated dropdown l
  • How to use remove-erase idiom for removing empty vectors in a vector?
  • MySQL WHERE-condition in procedure ignored
  • Adding custom controls to a full screen movie
  • Matplotlib draw Spline from multiple points
  • Why winpcap requires both .lib and .dll to run?
  • Proper folder structure for lots of source files
  • Acquiring multiple attributes from .xml file in c#
  • How to set the response of a form post action to a iframe source?
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • unknown Exception android
  • java string with new operator and a literal
  • playing video using jmf
  • How to load view controller without button in storyboard?