Forum

Change WindowsMedia...
 
Notifications
Clear all

Change WindowsMediaPlayer mode, when file played is finished

19 Posts
3 Users
0 Reactions
234 Views
(@vicboa)
Posts: 9
Active Member
Topic starter
 

I am creating a learning system for children with cards that have an animal and a bar code. The idea is to play an initial video, in LOOP, asking the child to choose a card and pass it through the reader. Then, the system shows you a video of that animal, and returns to the initial video, again in LOOP, waiting for a new card. On Sheet1, I have column A with the barcodes, and column B with the file names. The system searches in col The code entered with the bar code, and plays the file in column B

So far, when I open the excel, start the initial video in LOOP, place the cursor in the combobox, and when reading a card, play the corresponding video, empty the combobox and reposition the cursor in the combobox What I do not achieve Do that at the end of it, replay the initial video in LOOP.

Another option i think is to work with 2 wmp. One for the permanent looping video and another for the interactive video, playing it over the permanent loop wmp player, and closing it when the play finish.

From now on, thanks for your help

 
Posted : 14/08/2018 12:10 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Victor,

Can you please attach a sample workbook with the code in it.

Regards

Phil

 
Posted : 14/08/2018 12:34 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

I feel this might be easier to do if written in a browser rather than Excel?

 
Posted : 14/08/2018 12:36 am
(@vicboa)
Posts: 9
Active Member
Topic starter
 

Hi Philip, thanks for your fast reply. Here is uploaded the file
rockola.xlsx.xlsm

 
Posted : 14/08/2018 12:49 am
(@vicboa)
Posts: 9
Active Member
Topic starter
 

About your comment "I feel this might be easier to do if written in a browser rather than Excel?"

I have chosen to use excel because the file list in Sheet1 and the mp4 files can be easily edited by any teacher without need programming knows.

Thanks again

Victor

 
Posted : 14/08/2018 1:23 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Victor

Give this a try.

You will need to adjust the codes to suit your needs.

Hope this helps.

Sunny

 
Posted : 14/08/2018 12:37 pm
(@vicboa)
Posts: 9
Active Member
Topic starter
 

Great job Sunny!!! tomorrow I will dedicate myself to work to adapt it exactly to what I need, but with just testing it, and some small modifications that I made, I think it is the just help I needed.Change the "LOOP" mode according to the file that is played, and creating a playlist ... when I get it ready, I'll comment again. (I'm going to sleep, in Argentina, it's 00: 00hs.) Thank you very much!

 
Posted : 14/08/2018 10:59 pm
(@sunnykow)
Posts: 1417
Noble Member
(@vicboa)
Posts: 9
Active Member
Topic starter
 

Hi SunnyKow!! The code already works correctly! I deeply appreciate the quick and careful response.
The next step i´ll do is to try to remove the caption and the close buton to the userform.
Regards
Victor

 
Posted : 16/08/2018 11:48 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Victor

Thanks for your feedback.

Good to know the codes are useful to you.

Cheers

Sunny

 
Posted : 16/08/2018 7:19 pm
(@vicboa)
Posts: 9
Active Member
Topic starter
 

Dear Sunny. Unfortunately the code has stopped working.
I have run it on another computer and it works correctly.
I have tried reinstalling Excel, but the problem persists. (I work with excel in Spanish)
I have removed the ErrorTrap and the error it indicates is:
- the error '-2147418113 (8000ffff)' occurred at runtime:
Error in the 'newPlaylist' method of object 'IWMPPlaylistCollection'

Any ideas?

Thank you again

Victor

 
Posted : 17/08/2018 8:39 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Victor

I have tested the codes on my personal PC and at the workplace with no problem whatsoever.

Possibly Excel version problem (I am using Excel 2010) but I am not sure if it will run on a higher version of Excel.

I had encountered problems before with 32 and 64 bit version of Excel. Possible this could be the problem.

I may be wrong but I am not sure. Sorry I am unable to help on this issue.

Sunny

 
Posted : 17/08/2018 11:02 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Victor

I have tested it on Excel 2013 (64-bit) and did not encounter any problem.

I really have no idea what is causing your error.

Sunny

 
Posted : 17/08/2018 8:46 pm
(@vicboa)
Posts: 9
Active Member
Topic starter
 

Hello Sunny! I have tried reinstalling Excel, installing the 2003, 2016, 2010 versions, and the problem persists. But I think I've finally found the problem.
Each time a video is played, a playlist is created, and saved in the music playlist folder as follows ...
MyPlayList
MyPlayList (2)
MyPlayList (3)
MyPlayList (4)
MyPlayList (5)
...
When the copy is called "MyPlayList (1999)" the error begins
I has trying change the playlistname (MyPlayList) with any other, and the code back to life!It makes me suspect that it is then a limit of wmp
The solution that I found, so that the name is not repeated, is to replace this line
Set sPlayList = WindowsMediaPlayer1.playlistCollection.newPlaylist ("MyPlayLists")

with this

Set sPlayList = WindowsMediaPlayer1.playlistCollection.newPlaylist ("MyPlayLists" & Now)

then the playlist files now has been saved as 

MyPlayLists16-08-2018 22-42-35
MyPlayLists16-08-2018 22-42-42
MyPlayLists16-08-2018 22-42-50
MyPlayLists16-08-2018 22-42-57
MyPlayLists16-08-2018 22-43-02
...
 impossible to be repeated!

I am very happy, I am testing it and at the moment it works correctly
What I do not like is that so many files are saved. I could solve it by finding a way to create a code that erases all files " MyPlayList.* " every time the Excel file is executed.

 
Posted : 17/08/2018 10:03 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hmm didn't know about the limit.

I would have deleted the old playlist (if one exist) before I play a new video.

 
Posted : 17/08/2018 10:28 pm
Page 1 / 2
Share: