jplayer for video 仅适用于 Chrome - 不适用于 FireFox 或 IE8

发布于 2024-12-10 21:42:59 字数 774 浏览 0 评论 0原文

我没有找到对此的太多支持,所以我猜测我的 jQuery 有一个简单的问题。任何原因为什么这只能在 Chrome 中播放,而不能在 FireFox 7.0.1 或 IE8 中播放

<script type="text/javascript">
    $(document).ready(function () {

        $("#jquery_jplayer_1").jPlayer({
            ready: function () {
                $(this).jPlayer("setMedia", {
                    m4v: "Media/sample_iPod.m4v"
                }).jPlayer("play");
            },
            swfPath: "../Data/Sites/1/skins/CCG/js/Jplayer.swf",
            supplied: "m4v",
            size: {
                width: "640px",
                height: "360px",
                cssClass: "jp-video-360p"
            }
        });
    });
</script>


<div id="jquery_jplayer_1" class="jp-jplayer">
</div>

任何帮助都值得赞赏。

I'm not finding much support for this, so I'm guessing there's a simple problem with my jQuery. Any reason why this would only play in Chrome, but not FireFox 7.0.1 or IE8

<script type="text/javascript">
    $(document).ready(function () {

        $("#jquery_jplayer_1").jPlayer({
            ready: function () {
                $(this).jPlayer("setMedia", {
                    m4v: "Media/sample_iPod.m4v"
                }).jPlayer("play");
            },
            swfPath: "../Data/Sites/1/skins/CCG/js/Jplayer.swf",
            supplied: "m4v",
            size: {
                width: "640px",
                height: "360px",
                cssClass: "jp-video-360p"
            }
        });
    });
</script>


<div id="jquery_jplayer_1" class="jp-jplayer">
</div>

Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱给你人给你 2024-12-17 21:42:59
$(document).ready(function(){
  $("#jpId").jPlayer({
        volume: 0.10,
        solution:"html,flash",
        mode: 'window', // this row is somehow crucial for safari
        preload:"auto",
        loop: true,
        errorAlerts: true,
        cssSelectorAncestor: "",
        cssSelector: {
           play: ".play",
           pause: ".pause",
        },
        ready: function () {
            $(this).jPlayer("setMedia", {
                oga: "http://www.mydomain.com/silentnight.ogg",
                m4a: "http://www.mydomain.com/silentnight.m4a",
                mp3: "http://www.mydomain.com/silentnight.mp3"
            }).jPlayer("play"); // Attempts to Auto-Play the media
        },
        supplied: "mp3,m4a",  //,oga
        swfPath: "/js"
  });
}); 

注意:这是针对音频的,但我想它对于视频也同样有效,所以你可以尝试一下。

我浪费了一整天的时间试图让它在 ie8 上运行,但是当你查看 jPlayer 主页上的演示时,它们也无法运行。微软应该宣布 IE8 死亡。

有了这个,我至少设法让它与 FF、Chrome 和 Safari 一起工作。据我了解 2.1.0 版本有问题,他们的 google 小组中的一些人建议降级到 2.0.0

$(document).ready(function(){
  $("#jpId").jPlayer({
        volume: 0.10,
        solution:"html,flash",
        mode: 'window', // this row is somehow crucial for safari
        preload:"auto",
        loop: true,
        errorAlerts: true,
        cssSelectorAncestor: "",
        cssSelector: {
           play: ".play",
           pause: ".pause",
        },
        ready: function () {
            $(this).jPlayer("setMedia", {
                oga: "http://www.mydomain.com/silentnight.ogg",
                m4a: "http://www.mydomain.com/silentnight.m4a",
                mp3: "http://www.mydomain.com/silentnight.mp3"
            }).jPlayer("play"); // Attempts to Auto-Play the media
        },
        supplied: "mp3,m4a",  //,oga
        swfPath: "/js"
  });
}); 

Note: this is for audio, but I guess it would work the same with video, so you could give it a try.

I've wasted my whole day tryin to get this to work on ie8, but as you look at the demos on jPlayer's homepage, they also wont work. Microsoft should declare IE8 dead.

With this I managed atleast to get it working with FF,Chrome and Safari. As I understand there is something wrong with the 2.1.0 version, some people in their google group advise downgrading to 2.0.0

美煞众生 2024-12-17 21:42:59

我的理解是,如果浏览器回退到 Flash,它将从用户位置而不是服务器位置调用媒体。尝试对您的媒体使用绝对网址。

m4v: "http://<yourHost>/Media/sample_iPod.m4v"

My understanding is that if the browser falls back to flash it will be calling the media from the user's location, not the server location. Try using absolute urls to your media.

m4v: "http://<yourHost>/Media/sample_iPod.m4v"
把梦留给海 2024-12-17 21:42:59

就我而言,有一大堆问题阻止了 jPlayer 在 IE8 中工作:

  1. IE8 作为后备加载的 swf 文件路径错误。我通过查看 Fiddler 中的 http 流量注意到了这一点。
  2. SWF 文件本身丢失,必须从 demos 文件夹中复制并安装在 swfPath 中。
  3. 视频必须使用设备重新编码:iPod、Handbrake 中的 Web 优化为 m4v。
  4. 它需要一张海报图像或它加载的 Flash 播放器出现在 jPlayer 下方。

终于成功了!

In my case there were a whole pile of issues stopping jPlayer working in IE8:

  1. the swf file that IE8 loads as a fallback had the wrong path. I noticed this by viewing the http traffic in Fiddler.
  2. the SWF file itself was missing and had to be copied from the demos folder and installed in the swfPath
  3. the video had to be re-encoded with device: iPod, Web Optimised in Handbrake as m4v.
  4. it needed a poster image or the flash player that it loaded appeared underneath the jPlayer.

Finally it worked!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文