I am trying to read a video from FS collection with gridFS. I succeded to read a video when i insert the video with an http url, like that :
Images.insert('http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4', function (err, fileObj) {
console.log(fileObj);//nothing
console.log(err);//nothing
});
Template.videoView.helpers({
videos: function () {
return Images.find(); // Where Images is an FS.Collection instance
}
});
Then in the HMTL file, i display the video like that and it works :
{{#each videos}}
<p> {{this.url}} </p>
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264">
<source src="{{this.url}}" type="video/mp4"/>
</video>
{{/each}}
But when i try to insert via local file path, it doesn’t work :
Images.insert(process.env.PWD + '/private/check_all_services_service_1&audio_jpn_2fe8_e217.mp4', function (err, fileObj) { console.log(fileObj);//nothing console.log(err);//nothing // Inserted new doc with ID fileObj._id, and kicked off the data upload using HTTP });
The video is well included in the collection like with the http link method but when i display on my web app, it says the video may be corrupted or nothing is shows.
Thanks in advance for any help