Play embedded video in UIWebView with HTML5

前端 未结 2 480
死守一世寂寞
死守一世寂寞 2020-12-22 12:31

I\'m actually trying to play a local video into an UIWebView, with HTLM5.

What I do actually is this :

NSString *embedHTML = [NSString stringWithFo         


        
2条回答
  •  萌比男神i
    2020-12-22 12:52

    Use this:

    NSString *embedHTML = [NSString stringWithFormat:@"
      ", [[NSBundle mainBundle] pathForResource:@"ash(1)" ofType:@"mov"]]; [webView setOpaque:NO]; //NSString *html = [NSString stringWithFormat:embedHTML, webView.frame.size.width, webView.frame.size.height]; NSURL *url = [NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"ash(1)" ofType:@"mov"]]; [webView loadHTMLString:embedHTML baseURL:url];

    Refer more this to how to play video using html5

提交回复
热议问题