facebook-live-embed-php
facebook-live-embed-php copied to clipboard
Any chance we can get this fixed ?
Any chance we can get this fixed ?
@KJThaDon It’s been quite a while and Facebook has changed a ton so it have require starting from scratch, however, I might not be opposed to trying.
What’s your use case right now?
@KJThaDon It’s been quite a while and Facebook has changed a ton so it have require starting from scratch, however, I might not be opposed to trying.
What’s your use case right now?
I am looking to have a permanent embed on a website front page. If there is a live stream going from a specific FB page, display it, if not maybe display an offline image or past broadcasts below it. The most important thing right now for me is to be able to have it pull the feed without having to change the embed code every new stream.
I appreciate the response! Been a headache trying to find a way to do this, when I feel like it should be a default embed option from FB.
Thank you
It doesn’t display any offline message, however, the following seems to display currently live video for the page and the most recently live otherwise.
<!-- For https://www.facebook.com/Fb.gameover.here/ -->
<iframe
src="https://www.facebook.com/plugins/video.php?href=https://www.facebook.com/Fb.gameover.here/live"
frameborder="0"
scrolling="no"
allowfullscreen="true"
height="1000px"
width="100%"
>
</iframe>
Here’s a demo you can try out https://jsfiddle.net/jgbkhcpx/2/
Looks like it’s not documented by facebook but I found it here: https://stackoverflow.com/a/64256497
It doesn’t display any offline message, however, the following seems to display currently live video for the page and the most recently live otherwise.
<!-- For https://www.facebook.com/Fb.gameover.here/ --> <iframe src="https://www.facebook.com/plugins/video.php?href=https://www.facebook.com/Fb.gameover.here/live" frameborder="0" scrolling="no" allowfullscreen="true" height="1000px" width="100%" > </iframe>Here’s a demo you can try out https://jsfiddle.net/jgbkhcpx/2/
Looks like it’s not documented by facebook but I found it here: https://stackoverflow.com/a/64256497
wow, I can't tell you how hard I've looked for a simple code like that lol
Thank you, I can work with this!
However, for some reason when testing it with other pages doesn't seem to be working. Just tried a handful and I am just getting.
"Video Unavailable This video may no longer exist, or you don't have permission to view it. "
Can you provide the code sample or page you're trying to use?
Example: Live right now
<iframe
src="https://www.facebook.com/plugins/video.php?href=https://www.facebook.com/TheTrueHitman/live"
frameborder="0"
scrolling="no"
allowfullscreen="true"
height="1000px"
width="100%"
>
</iframe>
Default Facebook embed code (working fine on same stream)
<iframe src="https://www.facebook.com/plugins/video.php?height=314&href=https%3A%2F%2Fwww.facebook.com%2FTheTrueHitman%2Fvideos%2F1479500709215605%2F&show_text=false&width=560&t=0" width="560" height="314" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share" allowFullScreen="true"></iframe>
It looks like it breaks when the URL redirects for a not-logged-in device.
https://www.facebook.com/TheTrueHitman/live
Redirects to:
https://www.facebook.com/TheTrueHitman/videos/1479500709215605/
https://www.facebook.com/Fb.gameover.here/live
No redirect
You may be able to fix this for your particular Facebook Page if you can figure out how https://www.facebook.com/Fb.gameover.here/live sets up their page not to redirect when viewed from an Incognito browser.
Ok, I think I may see why now. It looks like the page I posted vs the one you did, does not have the "live" tab showing (when accessed from a non logged in browser) in their Facebook page settings.
https://www.facebook.com/TheTrueHitman/ vs https://www.facebook.com/Fb.gameover.here/
In my case, this shouldn't be an issue since I can edit the page I am looking to embed. If anyone needs to know where to show the live tab, you can do so here
https://www.facebook.com/YOURPAGENAME/settings/?tab=edit_page
I'll have to test it for sure once we are live again, but thank you for the help!
I may be able to write a script that can solve this automatically.
If I do, I'll update this repo with the script and a method for using it.
I may be able to write a script that can solve this automatically.
If I do, I'll update this repo with the script and a method for using it.
I appreciate that very much!