Skip to content

Commit 8bb6674

Browse files
committed
fix videos not autoplaying when using control arrows in android
1 parent 1427059 commit 8bb6674

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

js/controllers/controls.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ export default class Controls {
8383
let pointerEvents = [ 'touchstart', 'click' ];
8484

8585
// Only support touch for Android, fixes double navigations in
86-
// stock browser
86+
// stock browser. Use touchend for it to be considered a valid
87+
// user interaction (so we're allowed to autoplay media).
8788
if( isAndroid ) {
88-
pointerEvents = [ 'touchstart' ];
89+
pointerEvents = [ 'touchend' ];
8990
}
9091

9192
pointerEvents.forEach( eventName => {
@@ -102,7 +103,7 @@ export default class Controls {
102103

103104
unbind() {
104105

105-
[ 'touchstart', 'click' ].forEach( eventName => {
106+
[ 'touchstart', 'touchend', 'click' ].forEach( eventName => {
106107
this.controlsLeft.forEach( el => el.removeEventListener( eventName, this.onNavigateLeftClicked, false ) );
107108
this.controlsRight.forEach( el => el.removeEventListener( eventName, this.onNavigateRightClicked, false ) );
108109
this.controlsUp.forEach( el => el.removeEventListener( eventName, this.onNavigateUpClicked, false ) );

0 commit comments

Comments
 (0)