1

Hi I'm having some question about embedding a browser into my app. actually I want this app have both Android and iOS version. what I want to do is: the app can embed a browser (like a view in the app). and the browser should support HTML5, and it should support playing rtsp stream. when I'm trying to do this, I'm facing some problems:

  1. Is there a possibility to embed a browser (like Safari or Chrome) into my app? Not by open a new window outside the app, actually I want it to be "In" the app.

  2. If I can embed a browser into my app, if the browser support html5, then Can I use the browser to show rtsp stream?

if I can't embed browser, Can I embed any html5 player which support rtsp?

thank you!

Ashley Shen
  • 115
  • 4
  • 12

2 Answers2

2

Yes and no

Yes you can embed an uiWebView that will have some functionality of a browser, you have a lot of control over what you can code.

rtsp , short answer no, IOS does not support rtsp so no html 5 tag will support rtsp

long answer, did this type of stuff several years ago.

https://github.com/mooncatventures-group/WebStreamX_flv_demo/blob/master/WebViewController.m

Here's key to how this works , this says if I click on a video link of the type defined then call the custom method to play a video otherwise process the link as a normal web link. there is other code in this git for playing rtsp feeds.

- (BOOL)webView:(UIWebView *)webView 
shouldStartLoadWithRequest:(NSURLRequest *)request 
 navigationType:(UIWebViewNavigationType)navigationType{
  url = [[request URL] absoluteString];
    if([url hasSuffix:@".m4v"]==YES || [url hasSuffix:@"mp4"]==YES || [url hasSuffix:@"mov"] == YES || [url hasSuffix:@"mpg"] == YES){

    [self playMovie:url];
    return NO;
}else {

return YES;
}
Michelle Cannon
  • 1,341
  • 8
  • 8
1

Although you can't embed Safari or Chrome, as for 1) on Android you can use the class WebView. On iOS you can use the UIWebView class. For 2) there's a related SO question here. HTH.

Community
  • 1
  • 1
Robert Karl
  • 7,598
  • 6
  • 38
  • 61