可以在iPhone / iPad应用程序中嵌入的浏览器可以使用HTML5标记发挥RTSP流?可以使用、应用程序、标记、浏览器

2023-09-07 08:50:37 作者:宝贝╮戒指菘ㄋ

你好我有有关嵌入浏览器到应用中的一些问题。其实我想这个应用程序同时拥有Android和iOS版本。我想要做的是:应用程序可以嵌入浏览器(如在应用程序的视图)。和浏览器应该支持HTML5,它应该支持播放RTSP流。当我试图做到这一点,我面临一些问题:

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:

有嵌入浏览器(如Safari或Chrome)到我的应用程序的可能?不被外界的应用程序打开一个新的窗口,其实我希望它是IN的应用程序。

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.

如果我可以嵌入浏览器到应用中,如果浏览器支持HTML5,那么我可以用浏览器显示RTSP流的?

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

如果我不能嵌入浏览器,我可以嵌入任何HTML5播放器支持RTSP?

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

谢谢!

推荐答案

是的,没有

是的,你可以嵌入一个UIWebView中,将有一个浏览器的一些功能,你有过什么,你可以code大量的控制。

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,简短的回答没有,IOS不支持RTSP所以没有HTML 5标签将支持RTSP

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

下面的关键是如何工作的,如果我点击确定,然后调用自定义的方法来播放视频,否则处理的链接作为一个正常的网站链接类型的视频链接这一说。有这混帐其他code,用于播放RTSP饲料。

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;
}