[TIMOB-16044] Android: Plugins keep playing after closing WebView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-12-23T22:33:17.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | 2013 Sprint 26, 2013 Sprint 26 API, Release 3.2.1, Release 3.3.0 |
Components | Android |
Labels | 3.2.0, android, module_webview, qe-testadded, webview |
Reporter | Wienke |
Assignee | Sunila |
Created | 2013-12-15T22:02:50.000+0000 |
Updated | 2014-01-22T21:55:27.000+0000 |
Description
Really love the new HTML5 video support in 3.2.
But when I load the webview in a window it the plugin (webhchrome client) Does not always stop playing. The Android docs say that you have to called the onPause function to clear all plugin activity. As far as I can see I don't see this happening here.
https://github.com/wienke/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java
We will investigate, but only consider this a blocker issue for 3.2.0 if it's a regression.
Removing dev-investigate and triage tags. We will schedule this once it is moved to a TIMOB ticket.
When I call the pause function on the webview on closing of the window it also does not pause the HTML5 video plugin. If there would be a way to expose the onPause method of the native webview or hook that up to the pause function then that would fix the problem.
Just another suggestion: Can it be that the trick with: https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java#L220 // Hidden APIs // http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/webkit/WebView.java;h=bbd8b95c7bea66b7060b5782fae4b3b2c4f04966;hb=4db1f432b853152075923499768639e14403b73a#l2558 internalWebViewPause = webView.getClass().getMethod("onPause"); internalWebViewResume = webView.getClass().getMethod("onResume"); is not working any more with API 19?
I tried it in a module which works. Please see this line. https://github.com/WappZapp/html5video-appcelerator-module/blob/master/src/tv/wappzapp/html5video/WebVideoProxy.java#L94 Shouldn't be that hard of a fix. I like the way you guys do it way better.
pause and resume webview when the activity is paused or resumed https://github.com/appcelerator/titanium_mobile/pull/5150
Great this is being worked on. Please let me know if I can be of any help in testing or otherwise.
Thanks guys! I compiled this in the 3.2.0 and it works like a charm. You guys rock! And have a good christmas.
Some stuff I notice with this solution: - 4.2 - when going to a window which as a video and leaving the video while playing, play does not work when you open a second screen with a window. When you hit the fullscreen button and play it, it will play but not from the non fullscreen container - 4.3 same behaviour but now the controls are also not showing.
[~wgiezeman] We believe the original reported issue has been fixed. We would appreciate if you can open another ticket for the new issues you are running into and we would troubleshoot these issues.
3_2_X: https://github.com/appcelerator/titanium_mobile/pull/5182
Environment Used - Appc-Studio: 3.2.1.201401061716 SDK Build:3.2.1.v20140106195644 and 3.3.0.v20140106195650 acs:1.0.11 alloy:1.3.1-beta npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.1.0 Osx: Maverick 10.9 Device:Nexus7(v4.3) Result - Not its working and not reproducible.