playing a local video in a uiwebview

浪子不回头ぞ 提交于 2019-11-30 10:28:27

oh my god

<video controls>
    <source src="banane.m4v">
</video>

where controls is the magic word.

:X

ifreeman

I may be wrong (or silly) but, did you try file:///banane.m4v (Add the extra '/' for root)

For everyone that experiences a crossed out play symbol, When you drag your movie-files (mp4's work as well, just make sure the codec is okay - easiest way is to export for iPhone with QuickTime) a dialog appears. Make sure you tick your app under "add to targets".

Or if you already copied your video into the project, if you click it in Xcode's file browser, you'll have an option on the right-hand side to select targets.

You need to set the allowsInlineMediaPlayback property on the UIWebView:

[webView setAllowsInlineMediaPlayback:YES];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!