Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any chance we can get this fixed ? #9

Open
KJThaDon opened this issue Sep 5, 2022 · 11 comments
Open

Any chance we can get this fixed ? #9

KJThaDon opened this issue Sep 5, 2022 · 11 comments

Comments

@KJThaDon
Copy link

KJThaDon commented Sep 5, 2022

Any chance we can get this fixed ?

@ThatGuySam
Copy link
Owner

@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
Copy link
Author

KJThaDon commented Sep 5, 2022

@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

@ThatGuySam
Copy link
Owner

ThatGuySam commented Sep 6, 2022

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

@KJThaDon
Copy link
Author

KJThaDon commented Sep 6, 2022

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!

@KJThaDon
Copy link
Author

KJThaDon commented Sep 6, 2022

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.
"

@ThatGuySam
Copy link
Owner

Can you provide the code sample or page you're trying to use?

@KJThaDon
Copy link
Author

KJThaDon commented Sep 6, 2022

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>

@ThatGuySam
Copy link
Owner

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.

@KJThaDon
Copy link
Author

KJThaDon commented Sep 6, 2022

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!

@ThatGuySam
Copy link
Owner

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.

@KJThaDon
Copy link
Author

KJThaDon commented Sep 6, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants