Attempt at autoplaying videos

- Upgrade XWalk to 22
 - Try to disable requirement for user gesture to play media on the
 Webview in different part of the code
This commit is contained in:
Anthony Callegaro 2016-11-03 23:49:20 +01:00
parent 66d7d32c37
commit 4ddd274cc7
4 changed files with 5 additions and 4 deletions

View File

@ -8,7 +8,7 @@
<uses-sdk
tools:ignore="OldTargetApi"
android:minSdkVersion="14"
android:minSdkVersion="16"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />

View File

@ -5,7 +5,7 @@ buildscript {
dependencies {
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
classpath 'com.android.tools.build:gradle:0.14.+'
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
@ -15,11 +15,10 @@ repositories {
}
}
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
dependencies {
compile 'org.xwalk:xwalk_core_library:16.45.+'
compile 'org.xwalk:xwalk_core_library:22.+'
}
allprojects {

View File

@ -165,6 +165,7 @@ public class DashboardActivity extends Activity {
hideNavigationBar();
setContentView(R.layout.main);
mWebView = (DashboardWebView)findViewById(R.id.webview);
mWebView.getSettings().setMediaPlaybackRequiresUserGesture(false);
}
@Override

View File

@ -68,6 +68,7 @@ public class DashboardWebView extends XWalkView {
public DashboardWebView(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
getSettings().setMediaPlaybackRequiresUserGesture(false);
}
@Override