Flowplayer: Cannot read property 'play' of undefined

466 Views Asked by At

I am using this function to show few live webcams:

function loadWebcam_with_flowplayer($w_name, $w_url) {
    $(".forecastdate").html($w_name);
    $('#extern').one("load", function(){}).html('');
    flowplayer('#extern', {
            splash: true,
            ratio: 9/16, 
            clip: {
                live: true, 
                hlsjs: {
                    safari: true,
                    listeners: ["hlsError"],
                    bufferWhilePaused: false,
                },
                sources: [
                    // path to the HLS m3u8
                    { type: "application/x-mpegurl", src: $w_url},
                ]
            } 
        });

The problem is that when I call it with the first name and url it works, but from there on if I call again the function with another url, I always get a blank page and this console error message:

Uncaught TypeError: Cannot read property 'play' of undefined
    at flowplayer.min.js:6

I think I should close the previous instance before launching another, or similar actions, but I am lost as this is the first time I use flowplayer. Thanks for any hint.

0

There are 0 best solutions below