【问题标题】:jwplayer can't play video in iPad and iPhonejwplayer 无法在 iPad 和 iPhone 上播放视频
【发布时间】:2014-02-20 05:55:14
【问题描述】:

我想将 jwplayer 集成到我的 web 应用程序中,以便在 iPhone、iPad 上播放 .mov 视频。

集成 jwplayer 后,jwplayer 不会播放视频文件夹中的视频,该文件夹包含所有培训视频 [e:\video – 在我的本地机器中]。

但是如果我将 .mov 文件放入我的项目资源文件夹中,jwplayer 可以播放视频。它还可以从 url 播放视频。

以下 jwplayer 示例不工作

var    selectedTrainingPlayer = jwplayer("videoContainerDiv").setup({
                 'flashplayer': '<%=request.getContextPath()%>/resources/js/mediaplayer-5.10/player.swf',
                 'id': 'playerId',
                 'width': '642',
                 'height': '412',
                 'mute': false,
                 'volume' : '100',
                 'controlbar' : 'bottom',
                 'repeat': 'list',
                 'volume': 100,
                 'stretching' : 'exactfit',
                 'image': '<%=request.getContextPath()%>/spring/getVideoThumbnail?videoId='+trainingVideoId,
                 'file': '<%=request.getContextPath() %>/spring/video/1.mov'

            });

但是 jwplayer 可以播放 URL 或 golflessons 资源文件夹中的视频,请参考以下代码

var    selectedTrainingPlayer = jwplayer("videoContainerDiv").setup({
                 'flashplayer': '<%=request.getContextPath()%>/resources/js/mediaplayer-5.10/player.swf',
                 'id': 'playerId',
                 'width': '642',
                 'height': '412',
                 'mute': false,
                 'volume' : '100',
                 'controlbar' : 'bottom',
                 'repeat': 'list',
                 'volume': 100,
                 'stretching' : 'exactfit',
                 'image': '<%=request.getContextPath()%>/spring/getVideoThumbnail?videoId='+trainingVideoId,
                 'file': '<%=request.getContextPath() %> /resources/images/golflessons/Pro_Book myself_Single_Lesson.mov',

            });

当 jwplayer 没有播放视频时,eclipse 显示如下错误

原因:java.io.IOException:已建立的连接被主机中的软件中止在 sun.nio.ch.SocketDispatcher.write0(Native Method) 在 sun.nio。 ch.SocketDispatcher.write(Unknown Source) at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source) at sun.nio.ch.IOUtil.write(Unknown Source) at sun.nio.ch.SocketChannelImpl.write(Unknown Source ) 在 org.mortbay.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:170) 在 org.mortbay.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:221) 在 org.mortbay.jetty.HttpGenerator.flush( HttpGenerator.java:725)。

我的理解:

jwplayer 可以从 url 和 golflessons 资源文件夹访问视频。但它无法从项目文件夹之外访问视频。

我已尝试禁用防火墙和防病毒软件,但没有任何解决方案适合我。

但同样的工作流程在我的 windows 桌面上也能正常工作,问题只在 iPhone 和 iPad 上

请任何人指导我解决这个问题

【问题讨论】:

    标签: iphone ipad video jwplayer


    【解决方案1】:

    看起来好像您在这里使用的是 JW5。

    在这一行下:

    'volume': 100,
    

    添加:

    'provider': 'video',
    

    这应该可以解决您的问题。

    【讨论】:

    • 不,我也有那个解决方案......但它仍然无法正常工作,并引发同样的错误......我可以试试 jwplayer 6 吗?
    • 感谢您一直以来的支持。我无法理解您的留言“您有链接吗?”。您是指 jwplayer 中的登录帐户吗?
    • 我的意思是指向您尝试在您的网站上嵌入播放器的链接。
    • 这是什么类型的文件?加载视频文件.htm
    • 感谢您一直以来的支持。我使用 .mov 文件
    猜你喜欢
    • 2012-06-07
    • 1970-01-01
    • 2012-01-30
    • 2013-01-03
    • 2014-12-14
    • 2023-03-20
    • 2014-11-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多