@ -3,8 +3,6 @@ import {
Component ,
Component ,
createEffect ,
createEffect ,
createSignal ,
createSignal ,
For ,
onCleanup ,
onMount ,
onMount ,
Setter ,
Setter ,
Show ,
Show ,
@ -210,13 +208,16 @@ export const VideoPlayer: Component<VideoPlayerProps> = (props) => {
let [ playerTime , setPlayerTime ] = createSignal ( 0 ) ;
let [ playerTime , setPlayerTime ] = createSignal ( 0 ) ;
let [ duration , setDuration ] = createSignal ( 0 ) ;
let [ duration , setDuration ] = createSignal ( 0 ) ;
let [ playbackSpeed , setPlaybackSpeed ] = createSignal ( 1 ) ;
let [ qualityName , setQualityName ] = createSignal ( "" ) ;
onMount ( ( ) = > {
onMount ( ( ) = > {
const player = props . mediaPlayer ( ) ;
const player = props . mediaPlayer ( ) ;
player . subscribe ( ( { currentTime , duration } ) = > {
player . subscribe ( ( { currentTime , duration , playbackRate } ) = > {
setPlayerTime ( currentTime ) ;
setPlayerTime ( currentTime ) ;
props . setPlayerTime ( currentTime ) ;
props . setPlayerTime ( currentTime ) ;
setDuration ( duration ) ;
setDuration ( duration ) ;
setPlaybackSpeed ( playbackRate ) ;
} ) ;
} ) ;
player . streamType = "on-demand" ;
player . streamType = "on-demand" ;
} ) ;
} ) ;
@ -296,6 +297,62 @@ export const VideoPlayer: Component<VideoPlayerProps> = (props) => {
< div class = "vds-controls-spacer" > < / div >
< div class = "vds-controls-spacer" > < / div >
< media - menu class = "vds-menu vds-settings-menu" >
< media - tooltip class = "vds-tooltip" >
< media - tooltip - trigger >
< media - menu - button class = "vds-button vds-menu-button" >
< media - icon class = "vds-icon vds-menu-settings-icon vds-rotate-icon" type = "settings" / >
< / m e d i a - m e n u - b u t t o n >
< / m e d i a - t o o l t i p - t r i g g e r >
< media - tooltip - content class = "vds-tooltip-content" placement = "top" >
Settings
< / m e d i a - t o o l t i p - c o n t e n t >
< / m e d i a - t o o l t i p >
< media - menu - items class = "vds-menu-items vds-settings-menu-items" placement = "top" >
< section class = "vds-menu-section" role = "group" >
< div class = "vds-menu-section-title" >
< header > Speed < / header >
< div class = "vds-menu-section-value" > { playbackSpeed ( ) } x < / div >
< / div >
< div class = "vds-menu-section-body" >
< div class = "vds-menu-item vds-menu-slider-item" >
< media - speed - slider class = "vds-slider vds-speed-slider" max = { 8 } >
< div class = "vds-slider-track" > < / div >
< div class = "vds-slider-track vds-slider-track-fill" > < / div >
< div class = "vds-slider-thumb" > < / div >
< media - slider - steps class = "vds-slider-steps" >
< template >
< div class = "vds-slider-step" > < / div >
< / template >
< / m e d i a - s l i d e r - s t e p s >
< / m e d i a - s p e e d - s l i d e r >
< / div >
< / div >
< / section >
< section class = "vds-menu-section" role = "group" >
< div class = "vds-menu-section-title" >
< header > Quality < / header >
< div class = "vds-menu-section-value" > < / div >
< / div >
< div class = "vds-menu-section-body" >
< div class = "vds-menu-item vds-menu-slider-item" >
< media - quality - slider class = "vds-slider vds-quality-slider" >
< div class = "vds-slider-track" > < / div >
< div class = "vds-slider-track vds-slider-track-fill" > < / div >
< div class = "vds-slider-track vds-slider-track-progress" > < / div >
< div class = "vds-slider-thumb" > < / div >
< media - slider - steps class = "vds-slider-steps" >
< template >
< div class = "vds-slider-step" > < / div >
< / template >
< / m e d i a - s l i d e r - s t e p s >
< / m e d i a - q u a l i t y - s l i d e r >
< / div >
< / div >
< / section >
< / m e d i a - m e n u - i t e m s >
< / m e d i a - m e n u >
< media - tooltip >
< media - tooltip >
< media - tooltip - trigger >
< media - tooltip - trigger >
< media - caption - button class = "vds-button" >
< media - caption - button class = "vds-button" >