I'm developing an app that uses WebView to load external video (.mp4), but the page plays only audio, and the video is only "black". I've searched so much and did all possible things to try solve this problem but I failt. Can you help me?
MainActivity.java
-- REMOVED --
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="topflix.topflix">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:icon="@drawable/rounded"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:hardwareAccelerated="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="topflix.topflix.MainActivity">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/wv"
/>
</android.support.constraint.ConstraintLayout>
Print of activity_main.xml > click here
Video URL: http://media-br-am.crackle.com/1/3/v6/11zlf_480p.mp4
Website for tests: ntcdn.stream/prop/httpdelivery/modal
What I already did:
- Set hardwareAccelerated=true
- Set wv.setWebChromeClient(new WebChromeClient());
and the video screen persists in black, running only audio. What should I do??