add separate preference for fsvideo player

This commit is contained in:
Andrew Dolgov 2014-12-03 16:51:00 +03:00
parent 4493b17723
commit 80f5751d9a
4 changed files with 16 additions and 5 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
android:versionCode="293"
android:versionName="1.84" >
android:versionCode="294"
android:versionName="1.85" >
<uses-sdk
android:minSdkVersion="10"

View File

@ -318,6 +318,7 @@ public class ArticleFragment extends Fragment {
});
boolean acceleratedWebview = true;
boolean enableFullscreenVideo = m_prefs.getBoolean("enable_fs_video", false);
// prevent flicker in ics
if (!m_prefs.getBoolean("webview_hardware_accel", true) || useTitleWebView) {
@ -375,9 +376,11 @@ public class ArticleFragment extends Fragment {
} else {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
ws.setJavaScriptEnabled(true);
m_chromeClient = new FSVideoChromeClient(view);
m_web.setWebChromeClient(m_chromeClient);
if (enableFullscreenVideo) {
m_chromeClient = new FSVideoChromeClient(view);
m_web.setWebChromeClient(m_chromeClient);
}
}
}
@ -442,7 +445,7 @@ public class ArticleFragment extends Fragment {
//
}
if (savedInstanceState == null || !acceleratedWebview)
if (savedInstanceState == null || !acceleratedWebview || !enableFullscreenVideo)
m_web.loadDataWithBaseURL(baseUrl, content, "text/html", "utf-8", null);
else
m_web.restoreState(savedInstanceState);

View File

@ -259,4 +259,6 @@
<string name="headline_display_mode_default">Default</string>
<string name="headline_display_mode_no_images">No images</string>
<string name="headline_display_mode_compact">Compact</string>
<string name="prefs_enable_fs_video_summary">May cause graphical glitches on some devices.</string>
<string name="prefs_enable_fs_video">Fullscreen video support</string>
</resources>

View File

@ -143,6 +143,12 @@
android:key="use_volume_keys"
android:summary="@string/use_volume_keys_long"
android:title="@string/use_volume_keys" />
<CheckBoxPreference
android:defaultValue="false"
android:key="enable_fs_video"
android:summary="@string/prefs_enable_fs_video_summary"
android:title="@string/prefs_enable_fs_video" />
<CheckBoxPreference
android:defaultValue="false"
android:key="full_screen_mode"