micnews / react-jw-player

A React Component API for JW Player
195 stars 94 forks source link

In Safari, when source file is m3u8 I get an Error: no playable sources found #195

Open kshoell opened 2 years ago

kshoell commented 2 years ago

I do not see this issue in Chrome or other browsers with the same .m3u8 files.

If I set the file to be an .mp4, it loads successfully.

kshoell commented 2 years ago

I found a work around for this. When creating sources I have to add a second source that does not include the type attribute. This appears to work on Safari now.

const sources = [
        // without type, this fails to load in Chrome in my http dev environment
        {
            file: fileUrl,
            type: mimeType,
        },
        // Setting the type on Safari causes the .m3u8 file to fail to load properly
        // This second source will be loaded if the first one fails
        {
            file: fileUrl,
        },
    ]