admin管理员组文章数量:1322171
I've a little video.js player and i'm new to web devlopment. I want it to read my local videos but i've a message: "Sorry no patible source and playback technology were found for this video."
But: If i use the external link given by video.js as sample, i can read the video.
I downloaded some samples to try out. An OGV one worked on the website i downloaded it. But when i try with my own, it doesn't work and show the same error.
Here is the .jsp code :
<div id="videoPlayer">
<video id="videoClip" class="video-js vjs-default-skin"
controls preload="auto" width="640" height="360"
poster=".png"
data-setup='{"example_option":true}'>
<source src="/home/ogda/Bureau/war/src/main/resources/small.ogv type=video/ogg" />
</video>
</div>
<script type="text/javascript" language="javascript">
var videoPlayer = videojs("videoClip");
videoPlayer.on("pause", changeVideo);
//videoPlayer.src("/home/ogda/Bureau/war/src/main/resources/lol.mp4");
videoPlayer.play();
</script>
Thank you !
EDIT : ANSWER
Commenters were right. The solution was siomply to put the videos on a webserver !
I've a little video.js player and i'm new to web devlopment. I want it to read my local videos but i've a message: "Sorry no patible source and playback technology were found for this video."
But: If i use the external link given by video.js as sample, i can read the video.
I downloaded some samples to try out. An OGV one worked on the website i downloaded it. But when i try with my own, it doesn't work and show the same error.
Here is the .jsp code :
<div id="videoPlayer">
<video id="videoClip" class="video-js vjs-default-skin"
controls preload="auto" width="640" height="360"
poster="http://video-js.zencoder./oceans-clip.png"
data-setup='{"example_option":true}'>
<source src="/home/ogda/Bureau/war/src/main/resources/small.ogv type=video/ogg" />
</video>
</div>
<script type="text/javascript" language="javascript">
var videoPlayer = videojs("videoClip");
videoPlayer.on("pause", changeVideo);
//videoPlayer.src("/home/ogda/Bureau/war/src/main/resources/lol.mp4");
videoPlayer.play();
</script>
Thank you !
EDIT : ANSWER
Commenters were right. The solution was siomply to put the videos on a webserver !
Share Improve this question edited Sep 11, 2013 at 11:52 ogdabou asked Sep 9, 2013 at 21:50 ogdabouogdabou 5922 gold badges11 silver badges42 bronze badges 1- I suppose that line is not supposed to be mented out? – Hanlet Escaño Commented Sep 9, 2013 at 21:54
2 Answers
Reset to default 4This is a sandbox problem. The browser does not allow loading local resources for security reasons. If you need it still, use a local webserver on your machine.
Most major browsers don't allow you to load in local files, since that poses a security error, e.g. people stealing secure files.
You need to test this on localhost, or setup some other server to test it.
Or, if you're using Chrome, you can turn on the flag that'll allow you to load in local files.
chrome --allow-file-access-from-files
run this from mand line
本文标签: javascriptvideojs unable to read local videosStack Overflow
版权声明:本文标题:javascript - video.js unable to read local videos - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742117756a2421546.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论