Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JWPlayer can't play video

I am trying to use JWPlayer to play videos on my website.

The video file is given as an url from our server, but the thing is the url does not contains any format, since the file is stored as a blob on server side.

So, does anyone know how to solve it? Thanks.

Here is my code as javascript:

function loadVideoByUrlWithSize(elementId, videoUrl, videoThumbnail, width, height) {
    jwplayer(elementId).setup({
        file : videoUrl,
        image : videoThumbnail,
        width : width,
        height : height
    });
 }
like image 373
David_Wang Avatar asked Jul 19 '13 10:07

David_Wang


2 Answers

The JW Player does need to know the extension, but you can also set the type as well in the player setup().

If you are using JW6, under this line:

file : videoUrl,

Add:

type : 'mp4',

For example. If it is a flv, make it flv...

If you are using JW5, under this line:

file : videoUrl,

Add:

provider: 'video',

Hope this helps!

like image 103
emaxsaun Avatar answered Sep 18 '22 22:09

emaxsaun


It sounds as if JWPlayer requires the file extension to know how to play the file.
Try url rewriting (.htaccess, iis) and basically append .mp4 (or whatever the file type) to fix the issue.

like image 28
evolutionxbox Avatar answered Sep 21 '22 22:09

evolutionxbox