'Error Loading Player. No playable sources found
I am using WebView in my app. I have given the URL of page, web page loads correctly but streaming is not started and it says Error Loading Player. No playable sources found.
How to fix it?
public class MainActivity extends Activity {
WebView webView;
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webView = (WebView) findViewById(R.id.webView1);
try {
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl("URL");
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "Cannot load page",
Toast.LENGTH_SHORT).show();
}
}
Solution 1:[1]
You can do that by launching a specific application for streaming the video.
BUT NOTE:
users with only 1 suitable video app, will not see the dialog. Also, users that have set a default video app, will not see the dialog either. Hence, I would not limit myself, by launching a specific video application, and instead let the android users have a nice android experience.
Should you have very good reasons to launch a specific video player, you can use:
try {
Intent intent = new Intent("com.mxtech.videoplayer.ad"); // Will launch MX player
intent.setDataAndType(Uri.parse("your_path"), "video/*");
startActivity(intent);
} catch(ActivityNotFoundException e){
// the app mxplayer was not found...
Toast.makeText(this, "mx player is not installed", Toast.LENGTH_SHORT).show();
}
Solution 2:[2]
specify url like,
webView.loadUrl(http://stackoverflow.com/questions/22497047/error-loading-player-no-playable-sources-found);
instead of,
webView.loadUrl("URL");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Android |
Solution 2 | Sekhar Madhiyazhagan |