Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: update autoplay behavior #461

Merged
merged 3 commits into from
Oct 31, 2017
Merged

Fix: update autoplay behavior #461

merged 3 commits into from
Oct 31, 2017

Conversation

jeremypress
Copy link
Contributor

No description provided.

@@ -183,7 +183,7 @@ class Settings extends EventEmitter {
this.containerEl.classList.add(CLASS_SETTINGS_SUBTITLES_UNAVAILABLE);
this.containerEl.classList.add(CLASS_SETTINGS_AUDIOTRACKS_UNAVAILABLE);

if (Browser.isIOS()) {
if (Browser.isMobile()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chrome doesn't allow play without a user action and setting the autoplay tag is not respected, so i've turned off autoplay for mobile in general. https://developers.google.com/web/updates/2016/07/autoplay

@@ -905,6 +905,9 @@ class Preview extends EventEmitter {
case 'notificationhide':
this.ui.hideNotification();
break;
case 'previewnextfile':
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking this should be mediaend related and not previewnextfile because in the future we may not want to preview the next file if it is not a media file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, the message you broadcast should be for what happened, not what you want to happen, and then the subscriber then determines what it wants to do.

I'm thinking something like... mediaendautoplay? mediaend to me could be fired as an event that has nothing to do with autoplay, so appending autoplay makes it a bit more specific

@@ -905,6 +905,9 @@ class Preview extends EventEmitter {
case 'notificationhide':
this.ui.hideNotification();
break;
case 'previewnextfile':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, the message you broadcast should be for what happened, not what you want to happen, and then the subscriber then determines what it wants to do.

I'm thinking something like... mediaendautoplay? mediaend to me could be fired as an event that has nothing to do with autoplay, so appending autoplay makes it a bit more specific

@jeremypress jeremypress merged commit c4778f8 into box:master Oct 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants