autoSlide duration with playbackRate
The autoSlide duration of media elements with data-autoplay now takes the playbackRate of said media element into account when setting the duration so that autoSlide and the media element stay in sync.
This commit is contained in:
parent
255bde174c
commit
ea8964ddbf
1 changed files with 4 additions and 3 deletions
|
@ -3768,11 +3768,12 @@
|
||||||
// automatically set the autoSlide duration to the
|
// automatically set the autoSlide duration to the
|
||||||
// length of that media. Not applicable if the slide
|
// length of that media. Not applicable if the slide
|
||||||
// is divided up into fragments.
|
// is divided up into fragments.
|
||||||
|
// playbackRate is accounted for in the duration.
|
||||||
if( currentSlide.querySelectorAll( '.fragment' ).length === 0 ) {
|
if( currentSlide.querySelectorAll( '.fragment' ).length === 0 ) {
|
||||||
toArray( currentSlide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {
|
toArray( currentSlide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {
|
||||||
if( el.hasAttribute( 'data-autoplay' ) ) {
|
if( el.hasAttribute( 'data-autoplay' ) ) {
|
||||||
if( autoSlide && el.duration * 1000 > autoSlide ) {
|
if( autoSlide && (el.duration * 1000 / el.playbackRate ) > autoSlide ) {
|
||||||
autoSlide = ( el.duration * 1000 ) + 1000;
|
autoSlide = ( el.duration * 1000 / el.playbackRate ) + 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in a new issue