0

I want to embed the following iframe to a webview (or if possible a videoview.)

<iframe SRC='http://desistreams.tv/embed/discovery_science.php' width='600' height='470' marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling='no'></iframe>

The problem that occurs is that the video does not start. (I just see a gray area with ads. I read a couple of articles before about iframe and embedding on stack overflow, but most of them are about embedding youtube videos in their app. I want to know if it's possible to use a videoview to show the iframe (or the src of it) or if i can do it with a webview.

wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setBuiltInZoomControls(true);
if (Build.VERSION.SDK_INT < 8) {
    wv.getSettings().setPluginsEnabled(true);
} else {
    wv.getSettings().setPluginState(PluginState.ON);
}

i'm using loadhtml to load the iframe or even the direct link doesn't display but it works in my browser.

Verhelst
  • 1,492
  • 2
  • 22
  • 46

1 Answers1

-1

Flash is no longer supported on new devices,thus embedding them into a webpage is a bad practice.

I'd recommend you to send an Intent with the Uri/URL of video, this will play the video on another app, note that the back button will get the user back to your application.

Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setDataAndType(Uri.parse(videoPath), "video/mp4");
startActivity(intent); 
Kirill Kulakov
  • 10,035
  • 9
  • 50
  • 67
  • Thanks for your comment, however i need to put it in a view. (VideoView or WebView.) Also the link is a livestream (not an mp4 file.) Meaning other players in my app don't know how to handle the url as a video – Verhelst Nov 02 '12 at 17:33
  • The VideoView is a SurfaceView with a MediaPlayer object(if I'm not mistaken).As long as your android device support the format at which the video is streamed you shouldn't have any problem playing it on a VideoView or a custom SurfaceView with a MediaPlayer.Here is something related that might help you http://stackoverflow.com/questions/5335731/android-video-streaming-example – Kirill Kulakov Nov 02 '12 at 17:42