mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Streaming hls
This commit is contained in:
@@ -14,8 +14,7 @@ from logging import handlers
|
||||
from pathlib import Path
|
||||
from platform import uname
|
||||
from sys import platform
|
||||
|
||||
from flask import Flask, jsonify, redirect, request, send_from_directory
|
||||
from flask import Flask, jsonify, redirect, request, send_from_directory, render_template
|
||||
from waitress import serve
|
||||
|
||||
HOST_ADDRESS = "192.168.1.15"
|
||||
@@ -246,8 +245,9 @@ def stream_music():
|
||||
|
||||
:return: A JSON response containing a key "music_file_list" with the value of the variable `music_file_list`.
|
||||
"""
|
||||
return send_from_directory("/tmp/hls", "stream.m3u8")
|
||||
|
||||
#return send_from_directory("/tmp/hls", "stream.m3u8")
|
||||
return render_template("stream.html")
|
||||
|
||||
@app.route("/<string:file_name>")
|
||||
def stream(file_name):
|
||||
@@ -260,10 +260,10 @@ def stream(file_name):
|
||||
Returns:
|
||||
Response: The response containing the streamed file.
|
||||
"""
|
||||
# trunk-ignore(bandit/B108)
|
||||
video_dir = "/tmp/hls"
|
||||
return send_from_directory(video_dir, file_name)
|
||||
|
||||
|
||||
@app.route("/stream_mp3", methods=["GET"])
|
||||
def stream_music_mp3():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user