From 21e9b9713d794ed9ad645fb55d5a68083b43f492 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Fri, 18 Feb 2011 15:29:41 +0000 Subject: [PATCH] update slider as the video plays, and preserve playing state during slider drags --- net/systemeD/potlatch2/help/VideoPlayer.mxml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/systemeD/potlatch2/help/VideoPlayer.mxml b/net/systemeD/potlatch2/help/VideoPlayer.mxml index 866b0561..fdb6f89e 100644 --- a/net/systemeD/potlatch2/help/VideoPlayer.mxml +++ b/net/systemeD/potlatch2/help/VideoPlayer.mxml @@ -8,6 +8,7 @@ @@ -37,8 +38,11 @@ the user actually wants it.) */ + import mx.events.VideoEvent; + [Bindable] public var file:String; [Bindable] public var previewImage:String; + private var wasPlaying:Boolean; [Bindable] [Embed(source="../../../../embedded/video_play.png" )] public var playImage:Class; [Bindable] [Embed(source="../../../../embedded/video_pause.png")] public var pauseImage:Class; @@ -62,12 +66,17 @@ progressBar.maximum=video.totalTime; } public function progressThumbPress(event:Event):void { + wasPlaying=video.playing; video.pause(); playButton.source=playImage; } public function progressThumbRelease(event:Event):void { video.playheadTime = event.currentTarget.value; + if (wasPlaying) playVideo(); } + public function advanceProgress(event:VideoEvent):void { + progressBar.value = event.playheadTime; + } public function stopPlaying():void { if (!video.playing) return; video.pause(); -- 2.37.0