扫码关注官方订阅号
怎样用UIWebView的loadHTML方法加载视频?有embed标签,里面有视频链接。我用手机打的,完整标签复制不过来,希望有思路的或者做过的指点一下,万分感谢!
ringa_lee
NSString *url=@"your url";[self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];self.webview.scrollView.bounces = NO;[self.webview setMediaPlaybackRequiresUserAction:NO];
UIWebView打开视频链接的时候,会默认跳到MPMoviePlayerViewController.你可以直接创建一个MPMoviePlayerViewController,来加载视频
MPMoviePlayerViewController *moviePl = [[MPMoviePlayerViewController alloc] initWithContentURL:URL];[self presentMoviePlayerViewControllerAnimated:moviePl];
你可以试试
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
NSString *url=@"your url";
[self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
self.webview.scrollView.bounces = NO;
[self.webview setMediaPlaybackRequiresUserAction:NO];
UIWebView打开视频链接的时候,会默认跳到MPMoviePlayerViewController.你可以直接创建一个MPMoviePlayerViewController,来加载视频
MPMoviePlayerViewController *moviePl = [[MPMoviePlayerViewController alloc] initWithContentURL:URL];
[self presentMoviePlayerViewControllerAnimated:moviePl];
你可以试试