Implementing a complete Video Control

Hi, guys.

This is probably a dumb question, but I was playing with this example ( but I ended up stuck to implement two things:

1 - I’d like to control the timeline of the video with some kind of slider control. Is it possible with Fuse?

2 - I’d like to add just one button that plays and pauses the video, so the text will change depending on user’s action. According with the example above, I can only use the Resume or Pause tag once.

Oh, and the bonus question: The progress bar seems to expand from the center, rather than from left to right (as progress bars usually behaves). Is there a way to change that?

I will appreciate any help with that!!


That link you referenced shows an example:

<App Theme="Basic">
        <Video ux:Name="video" Dock="Fill" File="fuse_video.mp4" IsLooping="true" StretchMode="UniformToFill">
                <Change progressBar.Width="100" />
        <Rectangle ux:Name="progressBar" Dock="Bottom" Fill="#f00" Width="0%" Height="10" />
        <Grid Dock="Bottom" ColumnCount="2" RowCount="1">
            <Button Text="Play">
                    <Resume Target="video" />
                    <Pause Target="video" />

No, it doesn’t :frowning:

What doesn’t? The link, it does under “Video Example” that’s where I copied that code

Don’t get me wrong: You clearly wants to help and I really appreciate that. But I’m not a experienced developer, I’m primarily a designer. The example above has two buttons, instead of just one for play and pause the video; There’s not a way to control the timeline with a slider control (if there’s a way to do that, I don’t know how) and the progress bar expands from the center, rather than from left to right.

if you read my initial thread with caution, you will see that the example above doesn’t answer those questions.

Thanks again for your support.

Oh sorry didn’t show a full example, but that example shows how you would pause play. Depending on how much you learned of Fuse, you should be able to figure it out. I was basically showing you that the Pause and Play elements exist etc. Now for a full example I’ll leave that to someone else right now. I’ll try to reply with a full example when I get the chance, because I’ll have to run tests and debug for that.

Thanks for your attention, my friend. Hope someone can help me with that.

Have a look at this example:

            <Video ux:Name="_video" AutoPlay="false" Progress="{Property _slider.Value}" Margin="20" Dock="Fill" Url="" >                        
                    <Change _canPause.Value="true" />
                    <Change _canPlay.Value="false" />
            <StackPanel Dock="Bottom" Margin="2">
                <Slider ux:Name="_slider" Minimum="0" Maximum="1" />
                    <Rectangle Padding="10" CornerRadius="5">
                        <Text Value="Play" ux:Name="_text" TextAlignment="Center" />
                        <WhileTrue ux:Name="_canPause" Value="false">
                            <Set _text.Value="Pause" />
                                <Pause Target="_video" />
                        <WhileTrue ux:Name="_canPlay" Value="true">
                            <Set _text.Value="Play" />
                                <Resume Target="_video" />
                        <SolidColor Color="#0cf" />
                        <Stroke><SolidColor Color="#000" /></Stroke>

Fantastic! Exactly what I was looking for! Thanks!

A lot of value gained from just few lines of code. Fuse is indeed amazing…