Estou tentando publicar stream RTMP dynamic com javascript e php.
Eu quero obter o nome do stream da url e publicar o stream no meu player da web (jwplayer) como xxx.com/watch.php?chanel=music
Eu quero usar a música como meu nome de transmissão e quero mostrar o stream com o meu jwplayer. Suponha que minha hospedagem rtmp://xx.yy.zz.yy:1987/live
seja rtmp://xx.yy.zz.yy:1987/live
Agora eu quero obter o nome da música do stream da url e publicar o rtmp://xx.yy.zz.yy:1987/live/music
completo do stream rtmp://xx.yy.zz.yy:1987/live/music
através do jwplayer de forma dinâmica.
Se alguém atinja xxx.com/watch.php?chanel=sports, ele poderá ver o rtmp://xx.yy.zz.yy:1987/live/sports
stream.
Eu escrevi o seguinte script, mas não está funcionando
This div will be replaced by the JW Player var chanel = getQueryVariable("chanel"); function getQueryVariable(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]; } } } var host= ("rtmp://216.245.200.114/Live/"); var stream=host.concat(chanel); jwplayer('mediaplayer').setup({ width: "600", height: "500", primary: "flash", autostart: "true", repeat: 'always', sources:[ { file: stream } ] });
Agora, quando eu estou batendo no http://www.justlive24.com/watch.php?chanel=shomoy, não está carregando o jogador. Sou novato e estou tentando descobrir a solução. Sua breve explicação me ajudará a entender isso.
você tem erro de syntax:
1. http://joxi.ru/nvGdUxjKTJBNH3ESafE
2. http://joxi.ru/yPGdU_3JTJA7Y4XfP7M
também algumas correções todo …
tente este código: http://pastebin.com/UzhuVpXm
não esqueça de append jquery entre as tags principais
tente isso:
< ?php include ("template/header.html"); ?> This div will be replaced by the JW Player < ?php include ("template/footer.html"); ?>