rcorbellini
rcorbellini

Reputation: 1337

Open Stream camera from URL

I have static html with this code:

<html>
 <head>
 </head>
 <body>
 <img width='100%' height='100%' src='http:/ip:port//urlMyCam'>
 </body>
</html>

That HTML works fine when I use it on my computer with my so I can watch my cam in real time perfectly.

But now I am trying open this stream in android its not work.

Already tried this way (nothing happens):

webViewCamera.getSettings().setJavaScriptEnabled(true); 
webViewCamera.loadDataWithBaseURL("", "<html><head></head><body><img  src='" + urldisplay + "'></body></html>", "text/html", "UTF-8", "");

and this way with a videoView (Sorry, this video cannot be played ):

            MediaController mediaController = new MediaController(getActivity());
            mediaController.setAnchorView(videoViewCamera);
            videoViewCamera.setMediaController(mediaController);
            videoViewCamera.setVideoURI(Uri.parse(urldisplay.toString()));
            videoViewCamera.requestFocus();
            videoViewCamera.start();

Maybe another way? What am I doing wrong?

(EDITED) i got this error on LogCat

03-23 14:34:36.830: E/GenericSource(1831): [multipart/x-mixed-replace; boundary=--DigifortBoundary; charset=ISO-8859-1]
03-23 14:34:39.115: E/DivXPlugin(1830): DivXPlugin::onOpenDecryptSession() Not a Divx File.
03-23 14:34:39.115: E/SEC_DRM_PLUGIN_Playready(1830):  PlayreadyPlugIn::onOpenDecryptSession()   DRM_ASFVerify_Context_Initialize is failed
03-23 14:34:39.120: E/GenericSource(1831): initFromDataSource() mExtractor is NULL, mFlags is PREPARE_CANCELLED
03-23 14:34:39.120: E/MediaPlayer(9006): error (1, -1004)
03-23 14:34:39.120: E/MediaPlayer(9006): Error (1,-1004)

Upvotes: 1

Views: 1714

Answers (1)

rcorbellini
rcorbellini

Reputation: 1337

i leave it out this solution and use another app to open my stream, download RTSP Player and always use this app to open my url.

RTSP Player

    startActivity(new Intent(Intent.ACTION_VIEW).setDataAndType(Uri.parse(urldisplay.toString()), "video/*"));

Upvotes: 1

Related Questions