Play a video file from a Virtual URL
Turns out the main problem was to do with the embedding code of JWPlayer.
When the URL pointing to the video doesn't include a recognized video extension - the player doesn't know what to do - So it requires an explicit definition.
Here is a functioning embed code for JWPlayer:
(notice the explicit specification of 'provider':'video'
)
<video id="jwplayer_placeholder"
src="http://localhost/mysite/SecuredFile.ashx?File=1234"
height="270"
width="480">
</video>
<script type="text/javascript">
jwplayer("jwplayer_placeholder").setup(
{
modes:
[
{ type: "flash", src: http://localhost/mysite/jwplayer/player.swf" },
{ type: 'html5' },
{ type: 'download' }
],
'provider':'video'
});
</script>
Hope this helps someone...
video is downloading but not playing in browser
update :
now I know what was my problem exactly !!!!
on my server I'd installed dumpio module for my apache, which log request and response data and video files size were big enough to make me trouble :D
and the reason why It got better after video optimization was that video file sizes got smaller.
I didn't find the exact answer to my question and the reason why after a period of time my videos stopped getting played in browsers,but using following bash script I converted my videos and now they're working.
${FILE_PATH} = '/path/to/videos/directory'
list=`find ${FILE_PATH} -name "*.mp4"`
for file in ${list}
do
filename=$(basename "$file")
video_file="${filename%.*}"
echo "${video_file}.mp4"
ffmpeg -y -i "${video_file}.mp4" -vcodec libx264 -b:v 350000 -movflags +faststart "x${video_file}.mp4"
done
END=574
for i in $(seq 1 ${END}); do
if [[ -f "./$i.mp4" && -f "./x$i.mp4" ]]; then
rm "${i}.mp4"
mv "x${i}.mp4" "${i}.mp4"
fi
done
Related Topics
Convert String to Date in Swift
What's the Cleanest Way of Applying Map() to a Dictionary in Swift
Creating Custom Tableview Cells in Swift
Attach Parameter to Button.Addtarget Action in Swift
Uncaught Error/Exception Handling in Swift
Difference Between a Weak Reference and an Unowned Reference
Is Key-Value Observation (Kvo) Available in Swift
Swift 2 - Unsafemutablepointer≪Void≫ to Object
Segue and Button Programmatically Swift
Swift 5.0: 'Withunsafebytes' Is Deprecated: Use 'Withunsafebytes≪R≫(...)
Append Text or Data to Text File in Swift
Swiftui Ios14 - Navigationview + List - Won't Fill Space