Closed agamemnus closed 10 years ago
After some time investigating this issue, here are some conclusions:
So I believe that this is something on the side of Chromium, Canvas+ uses its own audio implementation, so that's why it is working in that environment. Can't figure out when this issue will be fixed, we'll be aware of any update of the chromium project that may solve this issue.
Cheers
But... it works (I mean, audio in general, not the test case, since it mentions window.CocoonJS, obviously) in my Chrome Android browser, which is 36.0.1985.128. I don't see how it can be Chromium...
Is it possible that you have volume set to 0? (even though, yes, it is .5 in your wrapper, but that may not be getting through...?)
Why does audio work in the launcher? (except for "audio on start", which doesn't work in the launcher)
About volume set to 0... is not the case. I had high volume.
CocoonJS Launcher uses the same rendering libraries as the cloud compiler, the result of a compilation made in the cloud compiler should be exactly the same running in CocoonJS Launcher.
In order to clarify this issue, and knowing that is a Chrome issue. What do you need to fix this issue?
@_@
I am very confused!
When I said volume was set to 0 I meant some sort of intermediate volume setting was inadvertenly set to 0, perhaps, not the system volume.
What do I need to fix this issue? I don't know, I'm not the one developing Webview+ and I don't have the Java source code. :-)
So, to recap: 1) In Webview+ and Webview, sound does not run without a touch event in both the launcher and the compiled apk... pretty important issue. 2) In Webview+ (Webview is fine, didn't test CANVAS!), on my Note 2 with Android 4.4.2, sound (which starts on touch events) runs only in the 2.0.2 launcher and it does not run in the cloud compiler. 3) My app plays audio from the phone's Chrome browser on touch. I have the 36.0.1985.128 Chrome Android browser.
I think this may be the same bug and possibly the reason why audio plays in the launcher -- different URLs.
http://code.google.com/p/chromium/issues/detail?id=387898
This doesn't explain why audio doesn't run without a click/touch event, however. Was this meant to be implemented in Webview+?
Hmm.
Maybe we need a prefix for local files, e.g. /android_asset/game/
or /android_asset/www/
?
This issue is related to this other issue: https://code.google.com/p/chromium/issues/detail?id=387898
The Chromium team has recently solved this problem. We'll include the fix in one of the next releases of the Webview+.
Hi. I represent the web development company. We are developing the game using Webview+ runtime, so this is very important for us. Can you clarify the date of new release with this fix? (at least the approximate date)
olegkalichak, meanwhile you can try building just with Cordova-Crosswalk, at least for Android. If you add a file in (for example) /platforms/android/assets/
called xwalk-command-line
you can add command line options. One of them is --disable-gesture-requirement-for-media-playback
which seems to be extremely recent. So just do (for example):
xwalk --disable-gesture-requirement-for-media-playback
:-D
Here is mine in full:
xwalk --disable-gesture-requirement-for-media-playback --use-mobile-user-agent --enable-begin-frame-scheduling --enable-fixed-position-compositing --enable-threaded-compositing --enable-accelerated-overflow-scroll --enable-overlay-fullscreen-video --in-process-gpu --disable-gpu-shader-disk-cache --enable-viewport --enable-viewport-meta --main-frame-resizes-are-orientation-changes --disable-composited-antialiasing --ui-prioritize-in-gpu-process --enable-delegated-renderer --profiler-timing=0 --prerender=auto --disable-gpu-watchdog --supports-dual-gpus=true --gpu-driver-bug-workarounds=1,8,43,45 --canvas-msaa-sample-count=0 --disable-low-res-tiling --disable-overlay-scrollbars
@olegkalichak the release is expected for the next week the latest.
(This is in the launcher. I'm on Android 4.4.2, Note 2. The compiled APK gives no sound at all. I tried both mp3 and ogg.)
Including this and the latest cocoon.min.js:
No audio on start or in 3s, only on click.