https://github.com/thatguysam/facebook-live-embed-php
Gets current or latest live stream from a Facebook page
https://github.com/thatguysam/facebook-live-embed-php
embed facebook facebook-page facebook-videos livestream
Last synced: 30 days ago
JSON representation
Gets current or latest live stream from a Facebook page
- Host: GitHub
- URL: https://github.com/thatguysam/facebook-live-embed-php
- Owner: ThatGuySam
- License: mit
- Created: 2017-05-12T19:51:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-06-06T02:35:45.000Z (over 2 years ago)
- Last Synced: 2025-07-20T00:40:23.690Z (3 months ago)
- Topics: embed, facebook, facebook-page, facebook-videos, livestream
- Language: PHP
- Size: 129 KB
- Stars: 22
- Watchers: 7
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Facebook Live Embed
## Introduction
> Gets current or latest live stream from a Facebook page
[Here's a demo!](http://fblive.samcarlton.com/)
Based on [youtube-live-embed](https://github.com/iacchus/youtube-live-embed)
## Code Samples
### Get Embed code
This generates the embed code for you with respect to width and height of the livestream(ie: Portrait live streams from phones)
```php
```### Get Embed URL
This just get the embed url so you can use it more custom ways
```php```
## Installation
### 1. Install
```sh
$ git clone https://github.com/ThatGuySam/facebook-live-embed
$ cd facebook-live-embed
$ composer install
```### 2. Configure
- Go to https://developers.facebook.com/
- Create a new app and get the App ID and the App Secret
- Get the link for the page you want to pull live streams from
- In the install folder rename config-sample.php to just config.php
- Edit config.php and add your App ID, App Secret, and Facebook Page Link respectively### 3. Include PHP Class
```php
require_once __DIR__ . '/GetFacebookLiveStream.php';```
### 4. Configure Live instance
```php
$FacebookLive = new GetFacebookLiveStream([
'facebook_page' => $fb_page, // Facebook Page URL or ID
'app_id' => FB_APP_ID, // Facebook App ID
'app_secret' => FB_APP_SECRET, // Facebook App Secret
'cache_stream_for' => 60, // How long to cache request for in seconds
]);
```### 5. Place in template
This generates the embed code for you with respect to width and height of the livestream(ie: Portrait live streams from phones)
```php
```### 5.1 Alternative custom use in template (Bootstrap)
```php
```## Request Private Consulting on this project