Play embedded video in UIWebView with HTML5

前端 未结 2 479
死守一世寂寞
死守一世寂寞 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:41

    just change base url as

    NSString *videoPath =[[NSBundle mainBundle] pathForResource:@"xxx" ofType:@"mov"];
    
    NSString *htmlString=[NSString stringWithFormat:@"  ", videoPath];
    
    NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
    [xwebview loadHTMLString:htmlString baseURL:baseURL];
    

提交回复
热议问题