mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-10-29 04:40:02 +01:00
fix videos not autoplaying when using control arrows in android
This commit is contained in:
7
js/controllers/controls.js
vendored
7
js/controllers/controls.js
vendored
@@ -83,9 +83,10 @@ export default class Controls {
|
|||||||
let pointerEvents = [ 'touchstart', 'click' ];
|
let pointerEvents = [ 'touchstart', 'click' ];
|
||||||
|
|
||||||
// Only support touch for Android, fixes double navigations in
|
// Only support touch for Android, fixes double navigations in
|
||||||
// stock browser
|
// stock browser. Use touchend for it to be considered a valid
|
||||||
|
// user interaction (so we're allowed to autoplay media).
|
||||||
if( isAndroid ) {
|
if( isAndroid ) {
|
||||||
pointerEvents = [ 'touchstart' ];
|
pointerEvents = [ 'touchend' ];
|
||||||
}
|
}
|
||||||
|
|
||||||
pointerEvents.forEach( eventName => {
|
pointerEvents.forEach( eventName => {
|
||||||
@@ -102,7 +103,7 @@ export default class Controls {
|
|||||||
|
|
||||||
unbind() {
|
unbind() {
|
||||||
|
|
||||||
[ 'touchstart', 'click' ].forEach( eventName => {
|
[ 'touchstart', 'touchend', 'click' ].forEach( eventName => {
|
||||||
this.controlsLeft.forEach( el => el.removeEventListener( eventName, this.onNavigateLeftClicked, false ) );
|
this.controlsLeft.forEach( el => el.removeEventListener( eventName, this.onNavigateLeftClicked, false ) );
|
||||||
this.controlsRight.forEach( el => el.removeEventListener( eventName, this.onNavigateRightClicked, false ) );
|
this.controlsRight.forEach( el => el.removeEventListener( eventName, this.onNavigateRightClicked, false ) );
|
||||||
this.controlsUp.forEach( el => el.removeEventListener( eventName, this.onNavigateUpClicked, false ) );
|
this.controlsUp.forEach( el => el.removeEventListener( eventName, this.onNavigateUpClicked, false ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user