Copy link to clipboard
Copied
Hii
i have two FLVPlayback on stage i need to control the both videos by one controller when back or skip some second the both videos moved to the same second , i have created seekBar "seekbar_mc" at stage and typ the code
myflv1.seekBar =myflv2.seekBar =seekbar_mc;
it give me 2 slider on seekBar but i need one only can controlling the 2 FLVPlayback
any one can help me please ?!
Copy link to clipboard
Copied
1. add an EnterFrame eventlistener to the stage that checks if any seekbar is being scrubbed
2.If yes:use
to get the value the user scrubbed to
3.use at last: the seek function on the other flvComponent:
to synchronize both videos
when synchronized the seekbars should be in synch to
you should be able to translate that to the case were you have a third, central seekbar on stage:
Caveat: its highly unlikely that this double streaming will work efficiently in a web based environment.
If you want to have it functioning reliably you should abandon the flvplayback component (which is only good when it comes to streaming)
and preloading both your videos in total, before you allow the user to scrub.
Copy link to clipboard
Copied
Thanks so much moccamaximum for your help but sorry can you explain in more details cos i am new in Flash
The instance name of FLVPlayback#1 : "myflv1", FLVPlayback#2 : "myflv2" and the seekBar on stage "seekbar_mc"
Thank you so much
Copy link to clipboard
Copied
if you absolutely must have a 3rd controller you shouldn`t take a seekbar, but a slider, and using the sliders value to jump to the playHEadTime of both videos.
1.drag a slider component on stage and name it "slider"
import fl.events.SliderEvent;
slider.addEventListener(SliderEvent.CHANGE, sliderChanged);
function sliderChanged(e:SliderEvent):void {
trace(e.target.value);
myflv1.seek(e.target.value);
myflv2.seek(e.target.value);
}
2.adjust the sliders maximum to your videos runtime
if your video is 300 seconds long use
slider.maximum = 300;
All bold text goes on the first frame of your timeline
Copy link to clipboard
Copied
Thank you moccamaximum but its not working
Copy link to clipboard
Copied
"its not working"
too unspecific to work with.
Errors when publishing. Look at the output (window>Outpit)
what does it say?
Copy link to clipboard
Copied
the slider didn't moved with videos like seekBar
Copy link to clipboard
Copied
myflv1.addEventListener(VideoEvent..PLAYHEAD_UPDATE, updateSlider
);
//assuming you adadpted the maxValue of your slider to match the duration (in seconds) of your video
function updateSlider(e:VideoEvent):void{
slider.value = Math.round(myflv1.playheadTime);
}
Copy link to clipboard
Copied
Error "1119: Access of possibly undefined property PLAYHEAD_UPDATE through a reference with static type Class."
The Code
myflv1.addEventListener(VideoEvent.PLAYHEAD_UPDATE, updateSlider
);
Copy link to clipboard
Copied
to be able to use
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/VideoEvent.html
you have to import the necessary class at the beginning of your code:
so this hgoes into the first frame of your first scene of your fla file:
import flash.events.VideoEvent
then don`t copy the code from the forums here, because the linebreaks might break the code in flash.
write it out like:
myflv1.addEventListener(VideoEvent.PLAYHEAD_UPDATE, updateSlider);
(without the new Line)
Copy link to clipboard
Copied
Thanks so much moccamaximum for your help but it is the same error