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

On Android/Chrome using camera failed with : Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture. #104

Open
Rebolon opened this issue Feb 1, 2016 · 3 comments

Comments

@Rebolon
Copy link

Rebolon commented Feb 1, 2016

Hi,

i try to use the camera on smartphone (android + chrome) and since few days i always have :

Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture. 

If i look at the package, the play() action is done on Template rendered, maybe it's the problem because the action is not triggered by user.

To reproduce:

  • just add the mdg:camera
  • render the template "camera" using {{> camera}} in your layout
  • start an nginx as a proxy with SSL (because getUserMedia no more works without SSL)
  • start meteor app
  • open Chrome on your Android device
  • fill the url of your computer
  • The video stream is not displayed, but you only have a photo
@Rebolon
Copy link
Author

Rebolon commented Feb 1, 2016

just added a Pull Request (PR13) that solve problems on Android Chrome

@Primigenus
Copy link

In lieu of this PR being accepted, it looks like adding the following code to your app will hotfix the issue:

Template.viewfinder.onRendered(function() {
  this.$("#video").attr("autoplay", "autoplay");
});

@Rebolon
Copy link
Author

Rebolon commented Mar 29, 2016

It seems to be a valid solution.
Actually i use my own solution in my own fork of this pakages stored in /packages/mobile-packages folder.

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 a pull request may close this issue.

2 participants