You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Tintin <19...@googlemail.com> on 2013/09/30 20:56:23 UTC
Spark VideoDisplay Control Conundrum
Hello
I am developing an application (Flash Builder 4.7) with a MVP approach to
its architecture. I have an mxml Application component in my 'View' which
comprises a Spark VideoDisplay and a Spark HSlider.
The VideoDisplay should display, but not autoPlay, an flv movie which has
been created at 1 frame per second with every frame a key frame. I simply
want the HSlider to 'scrub' my movie but cannot figure out how to
communicate the HSliders position to the VideoDisplay component.
The 'change' event on my HSlider calls a function in the Slider_Presenter
which obtains the HSlider's 'value' property value. Using this I thought I
could set a property in my Slider_Presenter and bind a property controlling
the VideoDisplay playhead position, but it seems not to be. There is a
'seek' method on the VideoDisplay but I can't see how to use this.
As you can see I don't want to place all my code in my 'View'. I want my
'View' to pass back the user interaction to my 'Presenter' and I want this
event handling to drive the VideoDisplay position through binding.
Alternatively could I bind one mxml component directly with the other in the
'View'?
Any advice very welcome.
Chris
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Spark-VideoDisplay-Control-Conundrum-tp2903.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: Spark VideoDisplay Control Conundrum
Posted by Tintin <19...@googlemail.com>.
No problem Phil
I will try some different CODECS to see if the lag is due to decompression
rather than the application's ability to 'seek' quickly.
I have developed this previously in Flash Professional but a change in Flash
Player recently caused it to stop seeking until the mouse was released from
the thumb button. I forced the seek method to be called periodically using a
timer to slow down the method calls which enabled 'live dragging' again but
it stutters as you drag. Following this I thought I would try using Flex and
the Spark components to see if I could improve the performance.
Chris
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Spark-VideoDisplay-Control-Conundrum-tp2903p2910.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: Spark VideoDisplay Control Conundrum
Posted by Philip Medlam <ph...@gmail.com>.
Apologies,
I misinterpreted t as the other way round:-(
I have also used the method you described, which worked for me.
But of course the hardware and other parameters may effect the "lag".
My test was on a 20MB video file and an iPad4
Again,
sorry for the misunderstanding.
Phil.
On Tue, Oct 1, 2013 at 5:19 PM, Tintin <19...@googlemail.com>wrote:
> Hello Philip
>
> Thanks for your reply. Unless I have not understood your thoughts correctly
> my scenario is the other way around. It's the movie which I am 'driving' by
> dragging the HSlider. Currently I am achieving this by calling the
> VideoDisplay.seek method and passing the HSlider.value as a time parameter.
>
> I can't see how the currentTimeChange event will help here as this infers
> the movie telling the HSlider when and where to go?
>
> Perhaps I misunderstand so do correct me.
>
> Chris
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Spark-VideoDisplay-Control-Conundrum-tp2903p2906.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>
--
Philip Medlam
Re: Spark VideoDisplay Control Conundrum
Posted by Tintin <19...@googlemail.com>.
Hello Philip
Thanks for your reply. Unless I have not understood your thoughts correctly
my scenario is the other way around. It's the movie which I am 'driving' by
dragging the HSlider. Currently I am achieving this by calling the
VideoDisplay.seek method and passing the HSlider.value as a time parameter.
I can't see how the currentTimeChange event will help here as this infers
the movie telling the HSlider when and where to go?
Perhaps I misunderstand so do correct me.
Chris
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Spark-VideoDisplay-Control-Conundrum-tp2903p2906.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
Re: Spark VideoDisplay Control Conundrum
Posted by Philip Medlam <ph...@gmail.com>.
I recall that I used the currentTimeChange
Something like:
<s:VideoDisplay id="myVid" source="Video/something.flv"
complete="endOfVideo()"
volume="0.75" autoPlay="false" autoDisplayFirstFrame="true"
currentTimeChange="lineChangeHandler(event)"
click="startVid(event)" width="100%" height="100%"/>
and
protected function lineChangeHandler2(event:TimeEvent):void
{
myCurrentVideoTime = event.time;
}
so instead of using "myCurrentVideoTime = event.time;", you can set the
percentage of the scrubber be be the myCurrentVideoTime/totaltime*100
and move the scrubber pointer to the appropriate position.
If your problem persists, I could write a sample bit of flex to help.
Phil.
On Tue, Oct 1, 2013 at 9:54 AM, Tintin <19...@googlemail.com>wrote:
> A progress update.
>
> I have changed my HSlider 'change' event to be as follows:
>
>
>
> This works, but the performance is poor. The video seems to lag behind and
> is quite jumpy. Can anyone suggest how to improve this please?
>
> Chris
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Spark-VideoDisplay-Control-Conundrum-tp2903p2904.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>
--
Philip Medlam
Re: Spark VideoDisplay Control Conundrum
Posted by Tintin <19...@googlemail.com>.
A progress update.
I have changed my HSlider 'change' event to be as follows:
This works, but the performance is poor. The video seems to lag behind and
is quite jumpy. Can anyone suggest how to improve this please?
Chris
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Spark-VideoDisplay-Control-Conundrum-tp2903p2904.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.