[TIMOB-10526] Android: Video created with object tag inside a webview does not automatically stop when the window/app is closed
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Hold |
Resolution Date | 2013-03-07T00:16:17.000+0000 |
Affected Version/s | Release 2.1.1 |
Fix Version/s | 2013 Sprint 05 API, 2013 Sprint 05 |
Components | Android |
Labels | SupportTeam, api |
Reporter | Nikhil Sharma |
Assignee | Vishal Duggal |
Created | 2012-08-21T11:18:33.000+0000 |
Updated | 2013-03-27T22:56:28.000+0000 |
Description
When you create a video in a webview with object tag (HTML5), the video doesn't automatically stop when the window/app is closed.
Repo Steps
1. Run the below code in app.js 2. Click back button and you can still hear the video playing in the background.
(function() {
var window = Titanium.UI.createWindow({
left : Titanium.Platform.displayCaps.platformWidth,
backgroundColor : '#787878',
navBarHidden : true,
opacity : 0.0,
layout : 'absolute'
});
var webView = Titanium.UI.createWebView({
top : 0,
scalesPageToFit : true,
left : 0,
width :'100%',
showScrollbars : false,
willHandleTouches : false,
disableBounce: false,
pluginState: Titanium.UI.Android.WEBVIEW_PLUGINS_ON
});
var html =
'<html>' +
'<head>' +
'<meta name="viewport" content="width=device-width,user-scalable=yes,initial-scale=1">' +
'</head>' +
'<body>' +
'<P>Video 1</P><P><div class="video_callout" style="width:330px;height:275px;">'+
'<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>'+
'<object id="myExperience1301289234001" class="BrightcoveExperience">'+
'<param name="bgcolor" value="white" />' +
'<param name="width" value="480" />' +
'<param name="height" value="270" />' +
'<param name="playerID" value="1052840410001" />' +
'<param name="playerKey" value="AQ~~,AAAABokGock~,bQUst1ZshUkZ7AWyIRKjmoefLfGQUFYx" />' +
'<param name="isVid" value="true" />' +
'<param name="isUI" value="true" />' +
'<param name="dynamicStreaming" value="true" />' +
'<param name="@videoPlayer" value="1301289234001" />' +
'</object>' +
'<script type="text/javascript">brightcove.createExperiences();</script>' +
'</body>' +
'</html>';
webView.html = html;
window.add(webView);
window.addEventListener('close',function(){
Ti.API.info('window closing');
});
window.open();
})();
in progress
The only workaround I have found is to change the page in the webview before closing the window. The problem and the workaround are all over the web. Something like this
Going to mark this ticket as HOLD because we should ideally fix it in code. However triage of this bug has exposed a bunch