javascript jwPlayer 视频未在 iPad/iPhone 上加载

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13830582/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 19:53:51  来源:igfitidea点击:

jwPlayer video not loading on iPad/iPhone

javascriptiphonehtmlipadjwplayer

提问by redolent

The Context

上下文

We have a fully-working donation widget for nonprofits. We're experiencing one caveat: the video won't load on the last part when using an iPodor iPhone.

我们为非营利组织提供了一个功能齐全的捐赠小工具。我们遇到了一个警告:使用iPodiPhone时,视频不会加载到最后一部分。

The Problem

问题

I must warn you, friends. This is a hard one.

我必须警告你,朋友们。这是一个艰难的。

For some reason, when I embed a jwPlayer video, on either iPhoneand iPadI receive the following message:

出于某种原因,当我在iPhoneiPad上嵌入 jwPlayer 视频时,我收到以下消息:

The video could not be loaded, either because the server or network failed or because the format is not supported: http://content.bitsontherun.com/jwp/2gQXJaVU.xml

无法加载视频,原因可能是服务器或网络出现故障,或者格式不受支持:http: //content.bitsontherun.com/jwp/2gQXJaVU.xml

Here are some key things to note:

以下是一些需要注意的关键事项:

  • See demo at: http://www.socialgoodnetwork.com/betterbutton/demo/?id=tvymca_3To get to the last slide, click "Give Now" and click "Submit" to get through the process. I put the same video in the first slide as the last.
  • The last slide (after the donation) won't display the video. If I play the video at the first slide, it works fine.
  • Happens on iPhoneand iPadonly
  • 请参阅以下演示:http: //www.socialgoodnetwork.com/betterbutton/demo/?id=tvymca_3要查看最后一张幻灯片,请单击“立即提交”并单击“提交”以完成整个过程。我在第一张幻灯片中放置了与最后一张相同的视频。
  • 最后一张幻灯片(捐赠后)不会显示视频。如果我在第一张幻灯片上播放视频,则效果很好。
  • 仅在iPhoneiPad上发生

The jwPlayer.js player options:

jwPlayer.js 播放器选项:

{
    "plugins":              {
                            "gapro": {
                                 'accountid':        "UA-XXXXXXXX-1"
                                ,'trackstarts':      true
                                ,'trackpercentage':  true
                                ,'tracktime':        true
                                } 
                            },
    "gapro.accountid":      "UA-XXXXXXXX-1",
    "logo.hide":            "true",
    "logo":                 {hide: true},
    "file":                 params.url,
    "repeat":               "none",
    "autostart":            "true",
    "playlist.size":        "200",
    "image":                "http://content.bitsontherun.com/thumbs/aQ5bdlXV-640.jpg",
    "stretching":           "uniform",
    "height":               "375",
    "playlist.position":    "none",
    "width":                "560",
    "controlbar.position":  "bottom",
    "skin":                 "http://d1rhaz9gq9lm5b.cloudfront.net/2Bbp4Z6O.zip",
    "ping.pixel":           "http://content.bitsontherun.com/ping.gif",

    "playerready":          "jwplayer.api.playerReady",

    'autostart':            true,

    "flashplayer":          "http://www.socialgoodnetwork.com/jwplayer.swf?logo.hide=true&plugins=gapro-1&gapro.accountid=UA-XXXXXXXX-1",
    'modes':                [
                                {type: 'html5'},
                                {type: 'flash', src: '/jwplayer.swf?logo.hide=true'}
                            ]
}

I must say, anything you can do to help - thanks in advance!

我必须说,您可以提供任何帮助-提前致谢!

采纳答案by redolent

For some reason, setting autostartto falsemade my videos work on iOS:

出于某种原因,设置autostartfalse让我的视频在 iOS 上运行:

    'autostart': false,

I'll try to post more information later. It could be that my videos are not encoded properly.

稍后我会尝试发布更多信息。可能是我的视频编码不正确。

回答by Ian Devlin

You are providing Flash only vidoes. Non of the iDevices support Flash, this is a decision taken by Apple.

您仅提供 Flash 视频。iDevices 不支持 Flash,这是 Apple 的决定。

You need to also provide your video sources in MP4 format to be playable on iDevices.

您还需要提供 MP4 格式的视频源才能在 iDevices 上播放。

This is pretty much what Justin McCraw said above/below.

这几乎就是贾斯汀麦克劳在上面/下面所说的。

回答by Justin McCraw

In order to make the HTML5 version work for iOS and other non-Flash enabled devices, you have to have the actual files hosted somewhere on your own or a third-party server. That is, you need to display .MP4 videos to users with iOS devices. YouTube videos also work. Is your params.url file for Flash .swf file? You can read more about this requirement from LongTail's documentation. Hopefully, I understood the problem correctly.

为了使 HTML5 版本适用于 iOS 和其他不支持 Flash 的设备,您必须将实际文件托管在您自己或第三方服务器上的某处。也就是说,您需要向使用 iOS 设备的用户显示 .MP4 视频。YouTube 视频也有效。你的 params.url 文件是 Flash .swf 文件吗?您可以从LongTail 的文档中阅读有关此要求的更多信息。希望我正确理解了这个问题。

回答by Tauri Alfa

I suppose there is a request for statistics. In my case the requested URL before and after playback from firebug looks like this:

我想有一个统计要求。在我的情况下,从 firebug 播放前后请求的 URL 如下所示:

http://i.n.jwpltx.com/v1/jwplayer6/ping.gif?tv=3867&ph=0&n=3242919060939303&aid=_&e=e&i=0&pv=6.6.3867&pu=http%3A%2F%2F[PAGE_URL]%2F&m=1&a=0&v=0&w=100%25&h=270&ed=0&pn=&pt=title

http://injwpltx.com/v1/jwplayer6/ping.gif?tv=3867&ph=0&n=3242919060939303&aid=_&e=e&i=0&pv=6.6.3867&pu=http%3A%2F%2F[PAGE_URL=1v] =0&w=100%25&h=270&ed=0&pn=&pt=title

If proxy blocks that address an error is shown. After configuring proxy to accept this type of requests, jwplayer works ok.

如果代理阻止该地址,则会显示错误。配置代理接受这种类型的请求后,jwplayer 工作正常。

Hope this will help somebody.

希望这会帮助某人。

回答by Anjali Mohan

I had a similar problem. The jwplayer was working fine in Chrome, but not in Safari, on iPad.

我有一个类似的问题。jwplayer 在 Chrome 中运行良好,但在 iPad 上的 Safari 中运行良好。

When I observed the browser settings, it was on private browsing mode . As the videos were stored in a secured server, the private browser will not be able to get the videos to the jwplayer. I changed the Safari browser private mode to non-private and the problem solved. The video was playing smooth.

当我观察浏览器设置时,它处于隐私浏览模式。由于视频存储在安全服务器中,私人浏览器将无法将视频发送到 jwplayer。我将 Safari 浏览器的私有模式更改为非私有,问题解决了。视频播放流畅。

Have a look on to this link - https://discussions.apple.com/thread/6240773

看看这个链接 - https://discussions.apple.com/thread/6240773

Hope this helps ...

希望这可以帮助 ...

Thanks, Anjali

谢谢,安贾利

回答by Taha Husain

Ipad and Iphone automatically detect mode in any version of JWPlayer. 'autostart' is also automatically disabled in Apple devices.

Ipad 和 Iphone 在任何版本的 JWPlayer 中自动检测模式。“自动启动”在 Apple 设备中也会自动禁用。

Key thing to note is video codec and Apple's specification. If the audio bitrate or sample rate is higher than the specs than you have to convert the video first.

需要注意的关键是视频编解码器和 Apple 的规范。如果音频比特率或采样率高于规格,则必须先转换视频。