admin管理员组文章数量:1435859
I use jwplayer.version = '5.10.2295' and browser chrome 25.
My code:
jwplayer('container').setup({
file: 'path...',
width: '300px',
height: '100px',
autostart: true,
modes: [
{ type: 'html5' },
{ type: 'flash', src: 'path...' }
]
});
When page is loaded my resource (mp4 video file) starts to show correctrly - it is ok. But there is no reaction on simple jwplayer JS API methods, suche as jwplayer().stop(), for example. And some controls are not available (play, top, seek), but 'to full screen mode' button works as well as volume button.
And the most interesting is that js api and control buttons available for a few seconds after video start to play (if browser cache is cleared), and then no response for interaction. But some method works all the time correctly (jwplayer().setFullscreen() for example).
p.s. I saw related question but the answer is not deep anough for me.
I use jwplayer.version = '5.10.2295' and browser chrome 25.
My code:
jwplayer('container').setup({
file: 'path...',
width: '300px',
height: '100px',
autostart: true,
modes: [
{ type: 'html5' },
{ type: 'flash', src: 'path...' }
]
});
When page is loaded my resource (mp4 video file) starts to show correctrly - it is ok. But there is no reaction on simple jwplayer JS API methods, suche as jwplayer().stop(), for example. And some controls are not available (play, top, seek), but 'to full screen mode' button works as well as volume button.
And the most interesting is that js api and control buttons available for a few seconds after video start to play (if browser cache is cleared), and then no response for interaction. But some method works all the time correctly (jwplayer().setFullscreen() for example).
p.s. I saw related question but the answer is not deep anough for me.
Share Improve this question edited May 23, 2017 at 12:21 CommunityBot 11 silver badge asked Dec 10, 2012 at 11:49 KalininKalinin 2,5198 gold badges37 silver badges49 bronze badges 02 Answers
Reset to default 2I found solution.
My video file have no specified extension in path (i have 'path/to/file' instead of 'path/to/file.mp4') and that fact brokes somethin in the depths of jwPlayer. We need to specify type of file we operate with:
jwplayer('container').setup({
file: 'path/to/file-with-no-extension',
width: '300px',
height: '100px',
autostart: true,
type: 'video', //helps jwplayer to determine how to handle our resource with no extension
modes: [
{ type: 'html5' },
{ type: 'flash', src: 'path...' }
]
});
That's solution.
Download jwplayer6 from http://www.longtailvideo./jw-player/download/
Put these files to the particular directory:-
- app/assets/jwplayer/jwplayer.flash.swf
- vendor/assets/javascripts/jwplayer.js
- vendor/assets/javascripts/jwplayer.html5.js
Then add these line in application.js
//= require jwplayer
//= require jwplayer.html5
On the page where you are playing video, add these lines
<script type="text/javascript">jwplayer.key="YOUR_JWPLAYER_KEY";</script>
<div id="video">Loading the player ...</div>
<script type="text/javascript">
jwplayer("video").setup({
flashplayer: "<%=asset_path('jwplayer.flash.swf')%>",
file: "<%= file_path %>",
height: 360,
width: 640,
analytics: {
enabled: false,
cookies: false
}
});
http://account.longtailvideo./#/home from where you can get your free self hosted key in signing up from Get Your License Key portion.
本文标签: google chromeJW Player javaScript API not workingStack Overflow
版权声明:本文标题:google chrome - JW Player javaScript API not working - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745672940a2669682.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论