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

autoplay videos does not work on cordova-IOS with Meteor 1.3 #7173

Closed
macrozone opened this issue Jun 5, 2016 · 7 comments
Closed

autoplay videos does not work on cordova-IOS with Meteor 1.3 #7173

macrozone opened this issue Jun 5, 2016 · 7 comments

Comments

@macrozone
Copy link
Contributor

macrozone commented Jun 5, 2016

On Meteor 1.2 it was possible to play videos on cordova-ios without user interaction:

<video src="/path/to/video.mp4 autoplay>`

With Meteor 1.3. autoplay no longer works.

There is a Cordova-Preference for this but this seems to have no effect:

App.setPreference("MediaPlaybackRequiresUserAction", false);

I created a simple repo to reproduce: https://github.com/macrozone/meteor-cordova-ios-video-autoplay.git

Can someone confirm?

Edit:

After a little bit debugging on xcode I found out that the setting "MediaPlaybackRequiresUserAction" is not passed to the WkWebview.

It seems that no property from cordova's config.xml is passed to WkWebview, there seems to be an open PR: apache/cordova-plugin-wkwebview-engine#7

Fortunalty I found a workaround: disabling the WKWebview:

App.setPreference("CordovaWebViewEngine", "CDVUIWebViewEngine");

@laosb
Copy link
Contributor

laosb commented Jun 6, 2016

looks like a Cordova bug. Is there anything meteor can do for this?

@macrozone
Copy link
Contributor Author

macrozone commented Jun 6, 2016

It's somewhat meteor related, because meteor choses wkwebview as default, whereas cordova has UIWebview as default.

This might be mentioned in the docs as a gotcha of wkwebview. It took me a really long time to figure out what's the problem and I think others might have the same problem.

Also the option to chose between wkwebview and uiwebview should be mentioned.

@laosb
Copy link
Contributor

laosb commented Jun 6, 2016

So there comes two issues in fact:

  • Mention the use of WKWebview in docs. (It has been mentioned in History.md, if you noticed that.)
  • Mention how to switch to UIWebview. (Personally I disagree, as UIWebview should be deprecated.)

@laosb
Copy link
Contributor

laosb commented Jun 6, 2016

Sounds like two docs issues now. @macrozone I would suggest your posting this to meteor/docs. Closing this on meteor/meteor.

@laosb laosb closed this as completed Jun 6, 2016
@macrozone
Copy link
Contributor Author

ok thx, @laosb , will do that.

(I would also love to see UIWebview deprecated, but the cordova-integration of WkWebview seems to be not ready yet as I think that not been able to autoplay videos is a major regression)

@macrozone
Copy link
Contributor Author

macrozone commented Jun 7, 2016

It seems that hotcode-reload does not work on cordova with UIWebview.

The webview does reload, when I do a change, but the change is not visible. I need to restart the app in order to see the change.

Can someone confirm this?

--> i'll open a new issue for this

@trymbill
Copy link

Thanks for the quick fix @macrozone, been looking for a solution to the autoplay issue for a few hours now and you just saved my night 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants