forked from ngrie/rtmpie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
219 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,6 @@ | ||
/* purgecss start ignore */ | ||
@tailwind base; | ||
@tailwind components; | ||
/* purgecss end ignore */ | ||
|
||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,37 @@ | ||
import FlvJs from 'flv.js' | ||
import { library, icon } from '@fortawesome/fontawesome-svg-core' | ||
|
||
import '../css/tailwind.css' | ||
|
||
import { faPlay } from '@fortawesome/free-solid-svg-icons' | ||
library.add(faPlay) | ||
|
||
document.getElementById('buttonIcon').innerHTML = icon({ | ||
prefix: 'fas', | ||
iconName: 'play', | ||
}).html | ||
|
||
document.getElementById('playButton').addEventListener('click', () => { | ||
document.getElementById('buttonWrapper').remove() | ||
if (FlvJs.isSupported()) { | ||
const playerEl = document.createElement('video') | ||
playerEl.autoplay = true | ||
playerEl.controls = true | ||
playerEl.classList.add('w-screen') | ||
playerEl.classList.add('h-screen') | ||
document.getElementsByTagName('body')[0].appendChild(playerEl) | ||
|
||
|
||
const player = FlvJs.createPlayer({ | ||
type: 'flv', | ||
isLive: true, | ||
url: stream_url, | ||
}) | ||
player.attachMediaElement(playerEl) | ||
player.load() | ||
player.play() | ||
setInterval(() => { | ||
player.play() | ||
}, 1000) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Controller; | ||
|
||
use App\Repository\StreamRepository; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
class PublicPlayerController extends AbstractController | ||
{ | ||
/** | ||
* @Route("/play/{streamSlug}", name="public_player") | ||
*/ | ||
public function index(string $streamSlug, StreamRepository $streamRepository, string $rtmpHttpFlvBaseUrl) | ||
{ | ||
$stream = $streamRepository->findOneBySlug($streamSlug); | ||
if (!$stream) { | ||
throw new NotFoundHttpException(); | ||
} | ||
|
||
$url = $rtmpHttpFlvBaseUrl . '?stream=' . $stream->getSlug(); | ||
|
||
return $this->render('public_player.html.twig', [ | ||
'url' => $url, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
|
||
<title>Stream Player</title> | ||
|
||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css"> | ||
|
||
{{ encore_entry_link_tags('publicPlayer') }} | ||
</head> | ||
<body> | ||
<div id="buttonWrapper" class="h-screen flex items-center justify-center text-lg text-gray-700"> | ||
<button type="button" id="playButton" class="flex flex-col items-center uppercase font-semibold tracking-wide p-4"> | ||
<span id="buttonIcon"></span> | ||
Play stream | ||
</button> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
var stream_url = '{{ url|raw }}'; | ||
</script> | ||
{{ encore_entry_script_tags('publicPlayer') }} | ||
</body> | ||
</html> | ||
|
||
{# The following Tailwind classes are used in publicPlayer.js, add them here to #} | ||
{# make sure they are included when running PurgeCSS: #} | ||
{# w-screen h-screen #} |
Oops, something went wrong.