Scott Solmer
Scott Solmer

Reputation: 3897

wmpPlayer Repeat Forever

I have a windows media player object embedded in my form and it's set to auto-play a video.
I want that video to loop forever, but can't figure out how!

Right-clicking the object in design view brings up settings and includes "Play count" but setting it to 0 won't work. It reverts to 1 as soon as the properties window is closed. Also it won't accept -1. The max setting is 999 which isn't enough as the video will only loop for a few hours.

This is how I am manipulating controls:

    wmpPlayer.Ctlcontrols.play()

    wmpPlayer.Ctlcontrols.pause()

    wmpPlayer.URL = ofdOpen.FileName 'Play

  ' This does NOT work to make repeat forever!...
  ' wmpPlayer.settings.playCount() = 0 

But I'm not sure if this method always works. I left my program running overnight on two machines and this morning one was still running but the other had stopped somehow.

Upvotes: 1

Views: 4104

Answers (2)

abdomohamed
abdomohamed

Reputation: 154

Or try with excel vba

WindowsMediaPlayer1.settings.setMode "Loop", True

Upvotes: 0

Idle_Mind
Idle_Mind

Reputation: 39152

I want that video to loop forever, but can't figure out how!

Just set the "Loop" mode property in settings to true:

wmpPlayer.settings.setMode("Loop", True)

Upvotes: 5

Related Questions