1. <i id='94z3z'><tr id='94z3z'><dt id='94z3z'><q id='94z3z'><span id='94z3z'><b id='94z3z'><form id='94z3z'><ins id='94z3z'></ins><ul id='94z3z'></ul><sub id='94z3z'></sub></form><legend id='94z3z'></legend><bdo id='94z3z'><pre id='94z3z'><center id='94z3z'></center></pre></bdo></b><th id='94z3z'></th></span></q></dt></tr></i><div id='94z3z'><tfoot id='94z3z'></tfoot><dl id='94z3z'><fieldset id='94z3z'></fieldset></dl></div>
      <tfoot id='94z3z'></tfoot>

      <small id='94z3z'></small><noframes id='94z3z'>

        <legend id='94z3z'><style id='94z3z'><dir id='94z3z'><q id='94z3z'></q></dir></style></legend>
          <bdo id='94z3z'></bdo><ul id='94z3z'></ul>

        在 UIWebView 中自动播放视频

        Video playing automatically in UIWebView(在 UIWebView 中自动播放视频)

            <tbody id='XBec7'></tbody>
        1. <small id='XBec7'></small><noframes id='XBec7'>

        2. <i id='XBec7'><tr id='XBec7'><dt id='XBec7'><q id='XBec7'><span id='XBec7'><b id='XBec7'><form id='XBec7'><ins id='XBec7'></ins><ul id='XBec7'></ul><sub id='XBec7'></sub></form><legend id='XBec7'></legend><bdo id='XBec7'><pre id='XBec7'><center id='XBec7'></center></pre></bdo></b><th id='XBec7'></th></span></q></dt></tr></i><div id='XBec7'><tfoot id='XBec7'></tfoot><dl id='XBec7'><fieldset id='XBec7'></fieldset></dl></div>
            • <legend id='XBec7'><style id='XBec7'><dir id='XBec7'><q id='XBec7'></q></dir></style></legend>
                <bdo id='XBec7'></bdo><ul id='XBec7'></ul>

                  <tfoot id='XBec7'></tfoot>

                  本文介绍了在 UIWebView 中自动播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  您好,我有一个 webview,当我尝试在其中加载视频文件时,它会自动开始播放视频,无需用户干预.并且播放按钮仍显示在 webview 中(视频正在播放).我正在使用以下代码来加载 URL

                  Hi I have a webview and when i tried to load the video files in that , it starts playing the video automatically without user intervention. And also the play button is still displayed in webview (video is playing behind that). I am using the following code to load the URL

                  NSURL*  url = [NSURL fileURLWithPath:filePath];
                  NSURLRequest*   request = [NSURLRequest requestWithURL:url];
                  [webView loadRequest:request];
                  

                  你能告诉我如何禁用播放按钮或者视频应该在用户点击播放按钮后才开始播放吗??

                  Can you tell me how to disable the play button OR the Video should start playing only after the user taps the play button ??

                  推荐答案

                  - (void)videoThumb:(NSString *)urlString frame:(CGRect)frame {
                            NSString *embedHTML = @"
                            <html><head>
                            <style type="text/css">
                            body {
                            background-color: transparent;
                            color: white;
                            }
                            </style>
                            </head><body style="margin:0">
                            <embed id="yt" src="%@" type="application/x-shockwave-flash" 
                            width="%0.0f" height="%0.0f"></embed>
                            </body></html>";
                  
                  
                    NSString *html = [NSString stringWithFormat:embedHTML, urlString, frame.size.width,frame.size.height];
                  
                    [webView loadHTMLString:html baseURL:nil];
                    [self.view addSubview:webView];
                    [webView release];
                  }
                  
                  //Include above function to your page and call it by passing the urlstring
                  [self videoThumb:url:frame];
                  
                  
                  //frame : this parameter needs the size of the thumb you want to use.
                  

                  我希望这可以帮助您并更好地实现您的目的.

                  I hope this may help you and better way for your purpose.

                  这篇关于在 UIWebView 中自动播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  iOS UIWebView app opens link in Safari(iOS UIWebView 应用在 Safari 中打开链接)
                  Close UIWebView using javascript:window.close();(使用 javascript:window.close() 关闭 UIWebView;)
                  NSCachedURLResponse returns object, but UIWebView does not interprets content(NSCachedURLResponse 返回对象,但 UIWebView 不解释内容)
                  Trouble hiding iAd banner and displaying UIWebView in its place(无法隐藏 iAd 横幅并在其位置显示 UIWebView)
                  Knowing when AJAX has loaded in UIWebView(知道何时在 UIWebView 中加载了 AJAX)
                  Load image/logo in existing HTML input field - UIWebView(在现有的 HTML 输入字段中加载图像/徽标 - UIWebView)

                  <small id='AZMz5'></small><noframes id='AZMz5'>

                    <tbody id='AZMz5'></tbody>

                    <bdo id='AZMz5'></bdo><ul id='AZMz5'></ul>
                  • <tfoot id='AZMz5'></tfoot>
                    • <legend id='AZMz5'><style id='AZMz5'><dir id='AZMz5'><q id='AZMz5'></q></dir></style></legend>

                          1. <i id='AZMz5'><tr id='AZMz5'><dt id='AZMz5'><q id='AZMz5'><span id='AZMz5'><b id='AZMz5'><form id='AZMz5'><ins id='AZMz5'></ins><ul id='AZMz5'></ul><sub id='AZMz5'></sub></form><legend id='AZMz5'></legend><bdo id='AZMz5'><pre id='AZMz5'><center id='AZMz5'></center></pre></bdo></b><th id='AZMz5'></th></span></q></dt></tr></i><div id='AZMz5'><tfoot id='AZMz5'></tfoot><dl id='AZMz5'><fieldset id='AZMz5'></fieldset></dl></div>