mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
Fixed local HLS video casting
This commit is contained in:
parent
e36047c890
commit
1e941cf6c5
1 changed files with 3 additions and 2 deletions
|
@ -501,14 +501,15 @@ class StateCasting {
|
|||
val id = UUID.randomUUID();
|
||||
val videoPath = "/video-${id}"
|
||||
val videoUrl = url + videoPath;
|
||||
val videoContainer = if (videoSource.container == "application/vnd.apple.mpegurl") "video/mp4" else videoSource.container;
|
||||
|
||||
_castServer.addHandlerWithAllowAllOptions(
|
||||
HttpFileHandler("GET", videoPath, videoSource.container, videoSource.filePath)
|
||||
HttpFileHandler("GET", videoPath, videoContainer, videoSource.filePath)
|
||||
.withHeader("Access-Control-Allow-Origin", "*"), true
|
||||
).withTag("cast");
|
||||
|
||||
Logger.i(TAG, "Casting local video (videoUrl: $videoUrl).");
|
||||
ad.loadVideo("BUFFERED", videoSource.container, videoUrl, resumePosition, video.duration.toDouble(), speed);
|
||||
ad.loadVideo("BUFFERED", videoContainer, videoUrl, resumePosition, video.duration.toDouble(), speed);
|
||||
|
||||
return listOf(videoUrl);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue