playing a local video in a uiwebview

后端 未结 4 1862
感情败类
感情败类 2021-01-01 02:35

i load a local html file into an ipad application:

NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
NSString *path = [[NSBundle m         


        
相关标签:
4条回答
  • 2021-01-01 02:44

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

    0 讨论(0)
  • 2021-01-01 02:45

    oh my god

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

    where controls is the magic word.

    :X

    0 讨论(0)
  • 2021-01-01 02:54

    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.

    0 讨论(0)
  • 2021-01-01 03:08

    You need to set the allowsInlineMediaPlayback property on the UIWebView:

    [webView setAllowsInlineMediaPlayback:YES];
    
    0 讨论(0)
提交回复
热议问题