An open API service indexing awesome lists of open source software.

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

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


= $FacebookLive->embedCode() ?>

```

### 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


= $FacebookLive->embedCode() ?>

```

### 5.1 Alternative custom use in template (Bootstrap)
```php




```

## Request Private Consulting on this project


Hire Sam Carlton