我将本地 html 文件加载到 ipad 应用程序中:
i load a local html file into an ipad application:
NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
NSString *path = [[NSBundle mainBundle] pathForResource:@"lieferant1" ofType:@"html"];
NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
[webView loadHTMLString:content baseURL:baseURL];
网页被显示,我的 html 文件的内容:
the webpage gets displayed, content of my html file:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
<p>
<video>
<source src="banane.m4v">
</video>
</p>
所以,banane.m4v
在我的根目录中,只是在某些组中,而不是在真正的目录中.
so, banane.m4v
is in my root, just in some groups, but not in real directories.
但我的网页视图中的视频部分保持黑色.没有视频被加载.我将我的 html 文件和我的 .m4v
视频上传到我的网络服务器,以检查它是否没有正确编码,但一切正常,用我的 ipad 浏览 html 文件.
but the video section in my webview keeps black. no video gets loaded. i uploaded my html file and my .m4v
video to my webserver to check if its not encoded properly, but everything works fine, surfing the html file with my ipad.
一些想法有什么问题?
天哪
<video controls>
<source src="banane.m4v">
</video>
其中 controls
是魔术字.
:X
这篇关于在 uiwebview 中播放本地视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!