aboutsummaryrefslogtreecommitdiff
path: root/modules/rtmp/static/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rtmp/static/index.html')
-rw-r--r--modules/rtmp/static/index.html75
1 files changed, 75 insertions, 0 deletions
diff --git a/modules/rtmp/static/index.html b/modules/rtmp/static/index.html
new file mode 100644
index 0000000..b206d1d
--- /dev/null
+++ b/modules/rtmp/static/index.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content=
+ "width=device-width, initial-scale=1">
+ <title>Streaaaaaaaaam</title>
+ <link rel="stylesheet" href="https://stream.vapor.systems/style.css">
+ <link href="https://vjs.zencdn.net/7.15.4/video-js.css" rel="stylesheet">
+</head>
+<body>
+ <style>
+ google-cast-launcher {
+ float: right;
+ width: 2rem;
+ height: 2rem;
+ display: inline-block;
+ margin: -0.3rem 0 -0.5rem 0;
+ }
+ </style>
+ <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
+ <div class="col">
+ <div class="row">
+ <div class="embed-responsive embed-responsive-16by9">
+ <video class="embed-responsive-item" id="video" autoplay="" controls="" muted=""></video>
+ </div>
+ </div>
+ </div>
+ <script>
+ var video = document.getElementById('video');
+ var videoSrc = 'https://stream.vapor.systems/hls/stream.m3u8';
+ if (Hls.isSupported()) {
+ var hls = new Hls();
+ hls.loadSource(videoSrc);
+ hls.attachMedia(video);
+ }
+ else if (video.canPlayType('application/vnd.apple.mpegurl')) {
+ video.src = videoSrc;
+ }
+ </script>
+ <script>
+ window['__onGCastApiAvailable'] = function(isAvailable) {
+ if (isAvailable) {
+ var castContext = cast.framework.CastContext.getInstance();
+
+ castContext.setOptions({
+ receiverApplicationId: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,
+ autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED
+ });
+
+ var stateChanged = cast.framework.CastContextEventType.CAST_STATE_CHANGED;
+ castContext.addEventListener(stateChanged, function(event) {
+ var castSession = castContext.getCurrentSession();
+
+ var media = new chrome.cast.media.MediaInfo('https://stream.vapor.systems/hls/stream.m3u8', 'application/vnd.apple.mpegurl');
+ var request = new chrome.cast.media.LoadRequest(media);
+
+ castSession && castSession
+ .loadMedia(request)
+ .then(function(){
+ console.log('Success');
+ })
+ .catch(function(error){
+ console.log('Error: ' + error);
+ });
+ });
+ } else {
+ console.log('Casting not avaible')
+ }
+ };
+ </script>
+ <script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>
+</body>
+</html>