Search code examples
phpstreamsharejwplayerfacebook-sharer

How to publish red5(any server) live stream on facebook?


I need to publish stream from RED5 server on facebook via Share Button. I use JW player for this, and AddThis sharing plugin, but it doesn't work.

I use facebook og metas.

    <?php $this->headMeta()->setProperty('og:type','video');?>
    <?php $this->headMeta()->setProperty('og:video:height','260');?>
    <?php $this->headMeta()->setProperty('og:video:width','420');?>
    <?php $this->headMeta()->setProperty('og:video:type','application/x-shockwave-flash');?>
    <?php $this->headMeta()->setProperty('og:description','stream-test-exaple');?>
    <?php $this->headMeta()->setProperty('og:title','stream-test');?>
    <?php $this->headMeta()->setProperty('og:image', 'http://example.com/img/jabba.gif'); ?>
    <?php $this->headMeta()->setProperty('og:video', 'http://example.com/js/plugins/jwplayer/player.sfw?file=rtmpt://example.com:5080/live/teststream');?>

Is there anything i do wrong? If you know another way to share streams on facebook please tell me about them, or any advices.

resource i used: http://www.jwplayer.com/blog/publish-your-videos-to-facebook-with-a-jw-player/

Publishing now works but when i press play player shows me this error:

jwplayer task queue failed at step 5 playlist could not be loaded due to crossdomain restrictions

and here are my crossdomain.xml

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE cross-domain-policy SYSTEM
        "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">


    <cross-domain-policy>
        <site-control permitted-cross-domain-policies="all" />
        <allow-access-from domain="*" />
        <allow-http-request-headers-from domain="*" headers="*" />
    </cross-domain-policy>

Thank you for your time!


Solution

  • You can't use:

    <?php $this->headMeta()->setProperty('og:video', 'http://example.com/js/plugins/jwplayer/jwplayer.js?file=rtmpt://example.com:5080/live/teststream');?>
    

    It has to be:

    <?php $this->headMeta()->setProperty('og:video', 'http://example.com/js/plugins/jwplayer/player.swf?streamer=rtmpt://example.com:5080/live/&file=teststream');?>
    

    Keep in mind this is for JW5, not JW6, as noted by the blog post you referenced.