Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1607] Android: WebView Enable Plugins

GitHub Issuen/a
TypeNew Feature
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-08-22T16:56:50.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sSprint 2011-33, Release 1.8.0
ComponentsAndroid
Labelsmodule_webview, qe-testadded
ReporterDon Thorp
AssigneeDon Thorp
Created2011-04-15T02:57:14.000+0000
Updated2012-02-08T17:22:17.000+0000

Description

In TIUIWebView set allow plugins true.

See http://developer.appcelerator.com/helpdesk/view/37021#c166301">Helpdesk 37201

This will probably require more research than that because in the past turning plugins on had no effect.

Comments

  1. Don Thorp 2011-08-18

    Example Code
       Titanium.UI.setBackgroundColor('#000000');
       
       var win1 = Titanium.UI.createWindow({  
           title:'WebView Plugins',
           backgroundColor:'#000000'
       });
       
       var btnOff = Ti.UI.createButton({
       	title : 'OFF',
       	width: 90,
       	height: 60,
       	top: 20
       });
       
       btnOff.addEventListener('click', function() {
       	var win = Titanium.UI.createWindow({
       		title: 'PLUGIN_STATE_OFF',
       		navBarHidden: false,
       		backgroundColor: 'black',
       		pluginState: Ti.UI.Android.WEBVIEW_PLUGINS_OFF,
       		url: 'timob-1607-webview.js'
       	}).open();
       });
       
       var btnOn = Ti.UI.createButton({
       	title : 'ON',
       	width: 90,
       	height: 60,
       	top: 100
       });
       
       btnOn.addEventListener('click', function() {
       	var win = Titanium.UI.createWindow({
       		title: 'PLUGIN_STATE_ON',
       		navBarHidden: false,
       		backgroundColor: 'red',
       		pluginState: Ti.UI.Android.WEBVIEW_PLUGINS_ON,
       		url: 'timob-1607-webview.js'
       	}).open();
       });
       
       var btnOnDemand = Ti.UI.createButton({
       	title : 'ON DEMAND',
       	width: 90,
       	height: 60,
       	top: 180
       });
       
       btnOnDemand.addEventListener('click', function() {
       	var win = Titanium.UI.createWindow({
       		title: 'PLUGIN_STATE_ON_DEMAND',
       		navBarHidden: false,
       		backgroundColor: 'blue',
       		pluginState: Ti.UI.Android.WEBVIEW_PLUGINS_ON_DEMAND,
       		url: 'timob-1607-webview.js'
       	}).open();
       });
       
       win1.add(btnOff);
       win1.add(btnOn);
       win1.add(btnOnDemand);
       win1.open();
       
       var win = Ti.UI.currentWindow;
       var activity = Ti.Android.currentActivity;
       
       var webview = Ti.UI.createWebView({
       	url:'http://www.youtube.com/embed/US7xaxyFETI',
       	pluginState: win.pluginState
       });
       
       win.add(webview);
       
       activity.addEventListener("pause", function() {
       	if (webview != null) {
       		webview.pause();
       	}
       });
       
       activity.addEventListener("resume", function() {
       	if (webview != null) {
       		webview.resume();
       	}
       });
       
  2. Michael Pettiford 2012-02-08

    Closing issue Tested with Ti Studio build 1.0.8.201201262211 Ti Mob SDK 1.9.0.v20120207171634 OSX Lion 10.7.3 Nexus S OS 2.3.5 v8/rhino Verified with a modified version of sample code, flash player installed, and the expected results of plugins being on/off/on demand is shown

JSON Source