【问题标题】:iframe doesn't play a video on android phoneiframe 无法在安卓手机上播放视频
【发布时间】:2012-08-17 13:05:18
【问题描述】:

我有一个不寻常的问题。它可能更多的是关于移动而不是 html/php。问题在于 iframe。

我在 iframe 中有一个视频播放器。当我点击播放按钮时 - 在所有浏览器上都可以正常工作,但在 Android 手机上却不行。它已显示,但单击后 - 未执行任何操作。但是 - 当我单击并按住按钮 > 菜单出现 > 我选择打开并且它工作正常。好诡异……

一般来说,我在其中一个 html 页面上有这个:

 <iframe src="http://jupiters.captive-portal.com/generic/ign-games/1.html" name="i1" target="_top" frameset frameborder=0 id="i1"></iframe>

这个 iframe 中的内容部分是 php / 部分是 html。 这就是全部:

<? 
$vidurl1 = "http://content.captive-portal.com/files/video/movie-news/vid1.mp4";
$thumburl1 = "http://content.captive-portal.com/files/video/movie-news/thumb1.jpg";
?>

@import url("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/ui-lightness/jquery-ui.css");

            <a href="<?=$vidurl1;?>" class="player" style="display:block;width:480px;height:360px;">
                <img src="<?=$thumburl1;?>" alt="Thumbnail for video"/>
            </a>


                <script type="text/javascript">
                    var video = document.createElement("video"),
                    idevice = /ip(hone|ad|od)/i.test(navigator.userAgent),
                    noflash = flashembed.getVersion()[0] === 0,
                    simulate = !idevice && noflash;
                    // REMOVE THE FOLLOW LINE TO DISABLE THE CODEC CHECK
                    simulate = simulate &&  !!(video.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, ''));
                    flowplayer("a.player", {
                        src:"http://video.captive-portal.com/flowplayer/flowplayer.commercial-3.2.11.swf",
                        wmode: "opaque"
                    }, {
                        key: "#$4871c81e02586ce7fdb",
                        clip: {
                            autoPlay: true,
                            scaling: "fit",
                            }
                    }
                    ).ipad( controls: true, simulateiDevice: simulate );

                </script>

我知道这可能意义不大,但是它在所有浏览器上都可以正常工作,但在 Android 上却不行。有什么我应该知道的才能让它工作吗?也许 iframe 会阻止播放器?有什么替代方法吗?

使用这种方法的原因是我每周需要将这个iframe的内容实现到很多页面,我不想修改5个页面。相反,我修改了由 iframe 注入的页面,它在我提到的 5 个页面上显示为更新。 这就是它在我的测试模式下的工作方式:test page

这对我来说至关重要,因此我将非常感谢发布的任何想法。先感谢您。 P.

【问题讨论】:

    标签: android iframe video-streaming


    【解决方案1】:

    好的,我已经解决了这个问题。这是玩家的错。此选项适用于不同的播放器,因此如果有人遇到相同的问题,我建议更换播放器。不工作的是flowplayer。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-24
      • 1970-01-01
      • 1970-01-01
      • 2018-01-18
      • 1970-01-01
      • 1970-01-01
      • 2020-02-10
      • 1970-01-01
      相关资源
      最近更新 更多