Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made a media player. I want to improve it.
I want to show the same media player that I made on the form1 page, on the form2 page. when a video plays I want to show both synchronously.

Edit: summary, I want to use one media player to show a video on multiple forms.

What I have tried:

I tried that code : axWindowsMediaPlayer1 = Form2.axWindowsMediaPlayer2
but its not working.
Posted
Updated 31-May-21 9:00am
v2
Comments
[no name] 31-May-21 12:57pm    
You have another option (since one usually doesn't run multiple media players at the same time): create a static "media player class" and share it. If a form wants to "play", it stops / pauses the player and loads its own content. I use a queue: flush the queue or add to it.

If you're saying you want to use one media player to show a video on multiple forms, that won't work, because a UI element can only belong to one visual tree at a time.
Selim Boz 31-May-21 14:36pm    
Thank you very much for the quick reply.

yes, I want to use one media player to show a video on multiple forms. is there any other way to do this, excluding create a 'static media player'?

thank you.
[no name] 31-May-21 22:48pm    
If you want to show a video on multiple forms, you need a media player on each form. If you want to have the same movie play in sync in all windows, you sync the media players (position). A static player works better for just speech / music in this case.

Create a user control (around a player) if you want to share any media player custom code or controls.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900