FORUMS
Remove All Ads from XDA

HTML 5 Video on Android 4.2.2 device (Geniatech ATV1220)

7 posts
Thanks Meter: 0
 
By egonwilzer, Junior Member on 19th May 2014, 12:25 PM
Post Reply Email Thread
Hello I am trying to build a simple webview.

But I can't get the video to work. It is working when I am using an emulated device with 4.2.2 running but on the actual device (Geniatech ATV1220) I just get a grey videobox and I can't play video at all. It is loading for a second but then it stops.

Here is my Main activity:

Code:
public class MainActivity extends Activity {

public static final String PAGE_URL = "video js website"; //is correct in code - just can't post links
final Activity activity = this;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);     
    WebView webview = (WebView) findViewById(R.id.webView);

    webview.getSettings().setJavaScriptEnabled(true);   
    webview.getSettings().setUseWideViewPort(true);
    webview.getSettings().setLoadWithOverviewMode(true);

    webview.setWebViewClient(new WebViewClient(){});        
    webview.setWebChromeClient(new WebChromeClient(){
        public void onProgressChanged(WebView view, int progress){
            activity.setTitle("Loading...");
            if(progress == 100){
                activity.setTitle(R.string.app_name);
            }
        }
    });     
    webview.loadUrl(PAGE_URL);
}
}
My Manifest where I enable hardware acceleration:

Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="schemas.android.com/apk/res/android" //+http , just cant post links
package="com.example.androidwebview"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="17"
    android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:hardwareAccelerated="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
    <activity
        android:name="com.example.androidwebview.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>
On my virtual device it is running alright. I am using a 4.2.2 device for that too.
But if I install the apk on the box it just opens the website and i see a gray video frame with a play button, that doesn't work. Also the controls are shown and if i fast forward a bit there is this circle loading thing but it doesn't load anything.

Can anyone help me get video to run on this device in my webview?
 
 
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes