
Quote from alessandropeana on February 7, 2021, 1:34 pmHi,
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!
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:

Quote from Vadim on February 7, 2021, 7:50 pm@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.
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:
Quote from alessandropeana on February 7, 2021, 11:18 pmHi @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
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

Quote from Vadim on February 8, 2021, 3:23 pm@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.
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:

Quote from alessandropeana on February 9, 2021, 10:15 amThanks a lot to you all!!!
I let you know if I will found other issues!
Thanks a lot to you all!!!
I let you know if I will found other issues!

Quote from alessandropeana on March 18, 2021, 12:06 pmDear @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
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


Quote from alessandropeana on March 18, 2021, 6:28 pm@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?
@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?

Quote from Vadim on March 18, 2021, 6:33 pm@alessandropeana
I haven't done any such programs, but a demo file comes with the plugins that will take away basic questions.
I haven't done any such programs, but a demo file comes with the plugins that will take away basic questions.

Quote from alessandropeana on March 18, 2021, 6:39 pmI 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
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

Quote from Vadim on March 18, 2021, 8:05 pm@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.
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.
Quote from Gaev on March 19, 2021, 1:30 am@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" EndIfc) 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.
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.