简体   繁体   中英

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

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM