Skip to content Skip to sidebar Skip to footer

Dynamic Rtmp Streaming With Jwplayer

I am trying to publish dynamic RTMP stream with javascript and php. I want to get stream name from url and publish the stream on my web player (jwplayer) like xxx.com/watch.php?ch

Solution 1:

you've syntax error: 1. http://joxi.ru/nvGdUxjKTJBNH3ESafE 2. http://joxi.ru/yPGdU_3JTJA7Y4XfP7M also some fixes todo...

try this code: http://pastebin.com/UzhuVpXm

don't forget to attach jquery between head tags

Solution 2:

try this:

<?phpinclude ("template/header.html");
?><scriptsrc="http://code.jquery.com/jquery-1.11.0.min.js"></script><scriptsrc="stream/jwplayer.js"></script><divclass="container-fluid"><divid="mediaplayer">This div will be replaced by the JW Player</div><script>functiongetQueryVariable(variable) {
                var query = window.location.search.substring(1);
                var vars = query.split("&");
                for (var i=0;i<vars.length;i++) {
                    var pair = vars[i].split("=");
                    if (pair[0] == variable) {
                        return pair[1];
                    }
                }
                return'';
            }
            $(function(){
                var chanel = getQueryVariable("chanel");
                var host= "rtmp://216.245.200.114/Live/";
                var stream=host+chanel;
                jwplayer('mediaplayer').setup({
                    width: "600",
                    height: "500",
                    primary: "flash",
                    autostart: "true",
                    repeat: 'always',
                    sources:[
                        {   file: stream    }
                    ]
                });
            });
        </script></div><?phpinclude ("template/footer.html");
?>

Post a Comment for "Dynamic Rtmp Streaming With Jwplayer"