David_Wang
David_Wang

Reputation: 670

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
    });
 }

Upvotes: 5

Views: 6100

Answers (2)

emaxsaun
emaxsaun

Reputation: 4201

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!

Upvotes: 7

evolutionxbox
evolutionxbox

Reputation: 4122

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.

Upvotes: 2

Related Questions