Video Player issue - Forum

Forum Navigation
You need to log in to create posts and topics.

Video Player issue

Hi,
I have a simple question:

Is it possible to play two sincronized video at the same time?

I found the following two impediments: the loading times of the player, and the sending of the play action.

I cannot run 2 actions at the same time (I can see from the debugger that the actions are being sent one after the other)

 

I think that I need a command like

MediaPlayerPlay "MediaPlayer1 and Mediaplayer2"

but I don't know if it exists or I don't know the right syntax

 

Thanks a lot for your time!

 

Uploaded files:
  • You need to login to have access to uploads.

@alessandropeana

The code runs line by line, but it works so fast that you can consider it a single start moment.

See sample for example (adjust paths to video files).

I used zmWMP plugin (Peter Pavlov), I attach it too.

Uploaded files:
  • You need to login to have access to uploads.

Hi @vadim

Thanks a lot for your time! the situation is better than before but i need more sincronization.

Have you any other idea? Maybe is there a way do add a little delay to the "play action" of the first video loaded?

 

Alessandro

You can use a timer for this

salu2

@alessandropeana

I used the same video in two files, running them in separate players. By ear, I did not notice any difference in timing.
Try using a timer as @rasl recommends.

Or here's another way to run them simultaneously - via While loop (specify desired start time in the code on the button and replace file paths with your own).

Check your application in compiled form. In test compile mode, a script always runs slower than it does in the finished application.

 

Uploaded files:
  • You need to login to have access to uploads.

Thanks a lot to you all!!!

I let you know if I will found other issues!

Dear @vadim, at the moment my visual demo trial has stopped. So I bought the program in order to continue testing. Now I'm waiting for the activation becouse i had some problems after checkout.

Anyway I've done a lot of practice with visual demo, but I'm having some problems with this project...

My goal is to:

Run my application who display 4 video boxes.

At the start of the page, the 4 videos should play simultaneously in sync. After 10 seconds, using a timer, the program should switch to a second page. On the second page there is the exact same situation: 4 video boxes who auto-play at the page start (the only difference is that the videos are different and located in different directories) and a timer who lounch the "come back to page 1" command.

It's a loop.

It is a little different from how I told it initially, the project has evolved a bit

I will show you a progress when visual neo activate my full version... but I'm not so far from the version you shared with me

thanks a lot for your help and for your time

@alessandropeana

For video playback you can also try this plugin:

zmVLC (Peter Pavlov)

@vadim  I will try it soon. can you create this program? I want to be sure that it works and created in the right way.
can you give me a quote in pvt?

@alessandropeana

I haven't done any such programs, but a demo file comes with the plugins that will take away basic questions.

I didn't make myself clear. I was asking if you can create the app described with visual neo, and if you can give me a quote

@alessandropeana

Here is a small example for playing 4 videos simultaneously.
Note that you need to specify correct path to VLC208 folder in zmVlcInit command (it comes with plugin). In my example this command is on the "Run" tab, in the project properties. You will have your own names for the video files too.

Uploaded files:
  • You need to login to have access to uploads.

@alessandropeana

A bit late to the conversation here but I think there is a solution that meets your requirements without using any plugins.

If the solution provided by @vadim works for you, ignore this post.

If it does not, or you want a pure native (no plugins) solution, here is the gist of it ...

1) The MediaPlayer tool provides ...

a) an event section (Begin Playing) that gets triggered when the media file is loaded from disk ... or when it is "played" after a previous "pause"

b) a Variable (to store playback position)

You can exploit these two facilities, along with a variable (one for each tool) where you store its current status (e.g. BeingLoaded or Loaded or Paused or Playing) ... let us call these variables [MediaPlayer1Status] to [MediaPlayer4Status].

So ...

a) just before you invoke the MediaPlayerPlay "MediaPlayerX" command, you set the value of the associated variable to "BeingLoaded"

b) in the Begin Playing event section, you change the value of the associated variable to "Loaded"; then, you then check the values of the 4 status variables like so ...

SetVar "[thisPlayer] "[self]"

If "[[thisPlayer]Status]" "=" "Playing"
   ... do nothing
   Return
Endif

... just loaded
SetVar "[[thisPlayer]Status]" "Loaded"

... check if any other files being loaded
SearchStr "Being" "[MediaPlayer1Status][MediaPlayer2Status][MediaPlayer3Status][MediaPlayer4Status]" "[LoadStatus]" ""
If "[LoadStatus]" ">" "0"
   ... at least one file being loaded; wait until all files loaded
   MediaPlayerPause "[thisPlayer]"
   ... current position
   SetVar "[[thisPlayer]]" "1"
   Return
EndIf

... all files have been loaded; now start playing those that are not already doing so
If "[MediaPlayer1Status]" "<>" "Playing"
   SetVar "[MediaPlayer1Status]" "Playing"
   MediaPlayerPlay "MediaPlayer1"
EndIf
If "[MediaPlayer2Status]" "<>" "Playing"
   Setvar "[MediaPlayer2Status]" "Playing"
   MediaPlayerPlay "MediaPlayer2"
EndIf
If "[MediaPlayer3Status]" "<>" "Playing"
   SetVar "[MediaPlayer3Status]" "Playing"
   MediaPlayerPlay "MediaPlayer3"
EndIf
If "[MediaPlayer4Status]" "<>" "Playing"
   SetVar "[MediaPlayer4Status]" "Playing"
   MediaPlayerPlay "MediaPlayer4"
EndIf

c) Optionally, if you do not want the user to see black rectangles while the MediaPlayer is "Paused", you can start with a HideObject and only ShowObject along with the MediaPlayerPlay command.

I have not been able to test it properly because I do not have any large media files; if you can provide 4 such files, I can test this out and post the pub.

luishp, Vadim and 2 other users have reacted to this post.
luishpVadimmishemproforma.guyot