Hi,
Need help if sombody can guide how can i slide the video playback using slider. Currently if i set progressanimation of the video with the slider, i cannot move the slider forward or backward after i’ve paused the video. Even if i pressed the slider and dragged it forward later it will go back to the position where it was paused earlier. Any suggestion??
<App Theme="Basic">
<Video ux:Name="video" Dock="Fill" Url="{videoUrl}" StretchMode="Uniform" AutoPlay="true">
<ProgressAnimation>
<Change Target="slider2.Value" Value="{videoThumb}" /> </ProgressAnimation>
</Video>
<Slider ux:Name="slider2" >
<float4 ux:Value="#FF5722" ux:Key="C500" />
<float4 ux:Value="#FBE9E7" ux:Key="CLine" /></Slider>
</App>
Below is the file…need advise from expert
<App Theme="Basic">
<JavaScript>
var Observable = require('FuseJS/Observable');
var videoUrl = "https://player.vimeo.com/external/159479292.sd.mp4?s=eaf5a274099379c41e7185cfabeff13ef490bd71&profile_id=164";
var videoProgress = Observable(0);
var slider2Value = Observable(0);
var slider1Value = Observable(0);
var newVideoTimeline = Observable(0);
var videoThumb = videoProgress.map(function(x){
return parseFloat(x*100).toFixed(2);
});
function changeSliderValue(args)
{
newVideoTimeline.value = parseFloat(args.value/100);
}
module.exports = {
videoUrl: videoUrl,
videoProgress: videoProgress,
newVideoTimeline: newVideoTimeline,
changeSliderValue: changeSliderValue,
videoThumb: videoThumb,
slider2Value: slider2Value,
slider1Value: slider1Value,
}
</JavaScript>
<DockPanel ux:Name="MainDock">
<StackPanel> <Panel>
<Slider ux:Name="slider1" Opacity="0" Width="100%" ProgressChanged="{changeSliderValue}">
<WhilePressed>
<Pause Target="video"/>
<Change Target="slider2.Opacity" Value="0"/> <Change Target="slider1.Opacity" Value="1"/>
<Set Target="slider1.Value" Value="{slider2Value}"/>
<DebugAction Message="While Pause"/>
</WhilePressed>
<Clicked>
<Resume Target="video" />
<DebugAction Message="Resume Play"/>
</Clicked>
</Slider>
<Slider ux:Name="slider2" >
<float4 ux:Value="#FF5722" ux:Key="C500" />
<float4 ux:Value="#FBE9E7" ux:Key="CLine" />
</Slider>
</Panel>
</StackPanel>
<Video ux:Name="video" Dock="Fill" Url="{videoUrl}" StretchMode="Uniform" AutoPlay="true">
<ProgressAnimation>
<Change Target="slider2.Value" Value="{videoThumb}" /> </ProgressAnimation>
</Video>
<DataBinding Target="video.Progress" Key="videoProgress"/>
<DataBinding Target="slider2.Value" Key="slider2Value"/>
<DataBinding Target="slider1.Value" Key="slider1Value"/>
<Grid Dock="Bottom" ColumnCount="4" RowCount="1">
<Button Text="Play">
<Clicked>
<Set Target="slider2.Value" Value="50.00" />
<Resume Target="video" />
</Clicked>
</Button>
<Button Text="Pause">
<Clicked>
<Set Target="slider1.Value" Value="{slider2Value}" />
<Pause Target="video" />
</Clicked>
</Button>
<TextInput Value="{slider2Value}" />
<TextInput Value="{newVideoTimeline}" />
</Grid>
</DockPanel>
</App>