Axwindowsmediaplayer loop play




















To play the sound repeatedly, we use the PlayLooping function of the SoundPlayer. Below is the code for that:. Note, in the above code, we got in the sound using the Properties.

Resources and then we assign the sound resource to the Stream Property of the SoundPlayer object. The Play Method will play the sound once and PlayLooping Method will play the sound file multiple times. The IntelliSense feature will help us add the resource added to the resource collection. When the user clicks the stop button, we call Stop method of the player and in the meantime enable the check box so that play mode can be changed.

Below is code for the stop method:. Note that the above method that is using the SoundPlayer class method which holds good only for playing the wav files. Windows Media Player control is not a standard control. This is usable as an active-x control and it will be free when you installed Windows Media Player in your system. The active-x control name is AxWindowsMediaPlayer. AxWindowsMediaPlayer control supports rich functions, but for this example, we will try a simple function of playing the sound file.

It loops, but only once So it plays the video, and once more. And then it just stop and shows the end of the video. So it seems as if it loops only once. Then in the event handler check if e. Edit: I don't know what you do with kind , or where the first part of your code is defined, but this worked for me:. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 8 years, 2 months ago. Active 4 years, 6 months ago. Viewed 20k times. AxWindowsMediaPlayer ; wmPlayer. ISupportInitialize wmPlayer. BeginInit ; wmPlayer. Fill; mainForm. Add wmPlayer ; System.

Answered by:. Archived Forums. Visual Basic. Not for VB6 questions. Sign in to vote. Click 'OpenFileDialog1. ShowDialog 'My. Then OpenFileDialog1. FileNames ListBox1. Count 'AxWindowsMediaPlayer1. Item myRandom. Next i 'AxWindowsMediaPlayer1. Count TextBox2. Click ListBox1. Load Timer1. Tick Label1. Skip to main content. This browser is no longer supported.

Download Microsoft Edge More info. Contents Exit focus mode.



0コメント

  • 1000 / 1000