Merge remote-tracking branch 'origin/main'
This commit is contained in:
0
ui/static/styles.css
Normal file
0
ui/static/styles.css
Normal file
12
ui/templates/base.html
Normal file
12
ui/templates/base.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Live Stream</title>
|
||||
</head>
|
||||
<body>
|
||||
{% block main_content %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
20
ui/templates/index.html
Normal file
20
ui/templates/index.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h1>Live Stream</h1>
|
||||
<video id="localVideo" autoplay playsinline controls></video>
|
||||
<script>
|
||||
// constant containing the video
|
||||
const videoElement = document.getElementById('localVideo');
|
||||
|
||||
// Request access to the user's camera and microphone
|
||||
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
|
||||
.then((stream) => {
|
||||
// Display the stream locally
|
||||
videoElement.srcObject = stream;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error accessing media devices.', error);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
19
ui/templates/video.html
Normal file
19
ui/templates/video.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<link href="http://vjs.zencdn.net/6.2.8/video-js.css" rel="stylesheet">
|
||||
<body>
|
||||
<video id="player" class="video-js vjs-default-skin" controls preload>
|
||||
<source src="/hls/stream.m3u8" type="application/x-mpegURL">
|
||||
</video>
|
||||
<script src="http://vjs.zencdn.net/6.2.8/video.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.4.0/videojs-contrib-hls.min.js"></script>
|
||||
<script>
|
||||
var player = videojs('player', {width: 1280, height: 720});
|
||||
player.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user