Dual video player

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
dspidell
Posts: 8
Joined: Mon Mar 09, 2020 6:40 pm

Dual video player

Post by dspidell » Wed Aug 25, 2021 3:24 pm

I'm working on a dual video player so video and a screen recording can be played at the same time, picture in picture or side by side. I've hidden the player controls and have a controller that controls both players simultaneously. My problem is finding a way to update the scrubber (slider) as the videos progress. No matter how I do it, it interrupts the playback of the videos briefly when it updates the scrubber position.

Currently the code looks like this:
on checkTime
Set the thumbposition of scrollbar "Scrubber" to the currentTime of player "Player1"
send "checkTime" to me in 2 seconds
end checkTime

I only update every 2 seconds to minimize the interruptions but it still causes a slight pause in the playback. I tried using currenttimechanged but that updates every frame so the videos were unintelligible.

I would appreciate any help I can get on this. Thanks.
Darren

Klaus
Posts: 12459
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Dual video player

Post by Klaus » Wed Aug 25, 2021 4:17 pm

Hi Darren,

has the scrollbar "Scrubber" a script of its own, e.g. to "scrub" through a movie?
In that case try this:

Code: Select all

on checkTime
  ## Avoid executing the scrollbars script, which will be the case if we: SET THE THUMBPOS OF PLAYER... TO ...
  lock messages
  Set the thumbposition of scrollbar "Scrubber" to the currentTime of player "Player1"
  unlock messages
  send "checkTime" to me in 1 seconds
end checkTime 
And please use the CODE tags </> after pasting your script(s).


Best

Klaus

dspidell
Posts: 8
Joined: Mon Mar 09, 2020 6:40 pm

Re: Dual video player

Post by dspidell » Wed Aug 25, 2021 8:05 pm

Thanks, that worked and thanks for the note about the code tags. I think I've only posted here once before. Very helpful community though:D

To answer your question, the script I posted was in the "Play" button. There is script in the scrubber to seek through videos when scrubbing. All good now, thanks again.

Darren

Post Reply

Return to “Multimedia”