gpt4 book ai didi

iPhone 在 WebView 中播放 youtube 视频

转载 作者:行者123 更新时间:2023-11-28 00:15:47 25 4
gpt4 key购买 nike

我无法播放这种格式的视频。

http://www.youtube.com/embed/lNOMZoF9VlM?rel=0

我的 html 字符串。

NSString *html = [NSString stringWithFormat:@"<html><head>\
<body style=\"margin:0\">\
<embed id=\"yt\" src=%@ type=\"application/x-shockwave-flash\" \
width=\"120\" height=\"120\"></embed>\
</body></html>",str];

请回复。

最佳答案

试试这个对我有用...

    CGRect frame = CGRectMake(40, 55, width, height);


NSString *embedHTML =[NSString stringWithFormat:@"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: transparent;\
color: blue;\
}\
</style>\
</head><body style=\"margin:0\">\
<iframe height=\"220\" width=\"400\" src=\"http://www.youtube.com/embed/lNOMZoF9VlM\"></iframe>\
</body></html>"];

webview = [[UIWebView alloc] initWithFrame:frame];

webview.backgroundColor = [UIColor clearColor];

webview.scrollView.scrollEnabled =NO;

[webview loadHTMLString:embedHTML baseURL:nil];

[self.view addSubview:webview];

关于iPhone 在 WebView 中播放 youtube 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12209994/

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