gpt4 book ai didi

ios - 如何显示 HTML5 页面

转载 作者:行者123 更新时间:2023-11-29 03:13:37 24 4
gpt4 key购买 nike

我使用 Google Web Designer 创建了一个 HTML5 页面。 Here

在模拟器中,自动播放功能无法正常工作。

视频也像下图一样被复制。

enter image description here

我用来展示的代码是:

- (void)viewWillAppear:(BOOL)animated{
NSURL *url = [NSURL URLWithString:@"http://finedine.s3.amazonaws.com/finedine_ads/video_ad.html"];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval: 10.0];
[webView loadRequest:requestObj];
self.webView.scalesPageToFit = YES;
}

我该如何解决这个问题?

更新:我用下面的代码显示它:

    if(!adView.isBeingPresented){
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard"
bundle: nil];
adView= (AdViewController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"AdViewController"];
}
if(![adView isBeingPresented])
[[KGModal sharedInstance] showWithContentViewController:adView];
//[self.window.rootViewController presentViewController:adView animated:YES completion:nil];

最佳答案

由于限制,嵌入 webview 时自动播放将不起作用,必须在网页上的某种触摸交互时调用 video.play()

User Control of Downloads Over Cellular Networks

In Safari on iOS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, preload and autoplay are disabled. No data is loaded until the user initiates it. This means the JavaScript play() and load() methods are also inactive until the user initiates playback, unless the play() or load() method is triggered by user action. In other words, a user-initiated Play button works, but an onLoad="play()" event does not.


关于视频中出现的双屏,这是youtube 提供的嵌入式视频的3d 版本。我没有使用过 Google Web Designer,但可能有某种设置可以加载另一种视频。

关于ios - 如何显示 HTML5 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21946065/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com