Add HLS VOD support
This commit is contained in:
@@ -583,7 +583,7 @@ var ShowContent = /** @class */ (function (_super) {
|
|||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case "log":
|
case "log":
|
||||||
var input = this.createInput("button", menuKey, "{{.button.resetlogs}}");
|
var input = this.createInput("button", menuKey, "{{.button.resetLogs}}");
|
||||||
input.setAttribute("onclick", 'javascript: resetLogs();');
|
input.setAttribute("onclick", 'javascript: resetLogs();');
|
||||||
interaction.appendChild(input);
|
interaction.appendChild(input);
|
||||||
var wrapper = document.createElement("DIV");
|
var wrapper = document.createElement("DIV");
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
"search": "Search",
|
"search": "Search",
|
||||||
"update": "Update",
|
"update": "Update",
|
||||||
"craeteAccount": "Create Account",
|
"craeteAccount": "Create Account",
|
||||||
"resetlogs": "Reset Logs",
|
"resetLogs": "Reset Logs",
|
||||||
"uploadLogo": "Upload Logo"
|
"uploadLogo": "Upload Logo"
|
||||||
},
|
},
|
||||||
"filter": {
|
"filter": {
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
},
|
},
|
||||||
"password": {
|
"password": {
|
||||||
"title": "Password",
|
"title": "Password",
|
||||||
"placeholder": "Passoword",
|
"placeholder": "Password",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"confirm": {
|
"confirm": {
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ InitBuffer:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Video Stream (TS)
|
// Video Stream (TS)
|
||||||
case "video/mpeg", "video/mp4", "video/mp2t", "application/octet-stream":
|
case "video/mpeg", "video/mp4", "video/mp2t", "application/octet-stream", "binary/octet-stream":
|
||||||
|
|
||||||
var fileSize int
|
var fileSize int
|
||||||
|
|
||||||
@@ -1027,7 +1027,7 @@ func parseM3U8(stream *ThisStream) (err error) {
|
|||||||
|
|
||||||
line = strings.Trim(line, "\r\n")
|
line = strings.Trim(line, "\r\n")
|
||||||
|
|
||||||
var parameters = []string{"#EXT-X-VERSION:", "#EXT-X-MEDIA-SEQUENCE:", "#EXT-X-STREAM-INF:", "#EXTINF:"}
|
var parameters = []string{"#EXT-X-VERSION:", "#EXT-X-PLAYLIST-TYPE:", "#EXT-X-MEDIA-SEQUENCE:", "#EXT-X-STREAM-INF:", "#EXTINF:"}
|
||||||
|
|
||||||
for _, parameter := range parameters {
|
for _, parameter := range parameters {
|
||||||
|
|
||||||
@@ -1043,6 +1043,9 @@ func parseM3U8(stream *ThisStream) (err error) {
|
|||||||
segment.Version = version
|
segment.Version = version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "#EXT-X-PLAYLIST-TYPE:":
|
||||||
|
segment.PlaylistType = value
|
||||||
|
|
||||||
case "#EXT-X-MEDIA-SEQUENCE:":
|
case "#EXT-X-MEDIA-SEQUENCE:":
|
||||||
n, err := strconv.ParseInt(value, 10, 64)
|
n, err := strconv.ParseInt(value, 10, 64)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -1194,6 +1197,11 @@ func parseM3U8(stream *ThisStream) (err error) {
|
|||||||
noNewSegment = false
|
noNewSegment = false
|
||||||
stream.LastSequence = segment.Sequence
|
stream.LastSequence = segment.Sequence
|
||||||
|
|
||||||
|
// Stream ist vom Typ VOD. Es muss das erste Segment der M3U8 Playlist verwendet werden.
|
||||||
|
if strings.ToUpper(segment.PlaylistType) == "VOD" {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if segment.Sequence > stream.LastSequence {
|
if segment.Sequence > stream.LastSequence {
|
||||||
|
|||||||
@@ -68,12 +68,13 @@ type ThisStream struct {
|
|||||||
|
|
||||||
// Segment : URL Segmente (HLS / M3U8)
|
// Segment : URL Segmente (HLS / M3U8)
|
||||||
type Segment struct {
|
type Segment struct {
|
||||||
Duration float64
|
Duration float64
|
||||||
Info bool
|
Info bool
|
||||||
Sequence int64
|
PlaylistType string
|
||||||
URL string
|
Sequence int64
|
||||||
Version int
|
URL string
|
||||||
Wait float64
|
Version int
|
||||||
|
Wait float64
|
||||||
|
|
||||||
StreamInf struct {
|
StreamInf struct {
|
||||||
AverageBandwidth int
|
AverageBandwidth int
|
||||||
|
|||||||
66
src/webUI.go
66
src/webUI.go
File diff suppressed because one or more lines are too long
@@ -714,7 +714,7 @@ class ShowContent extends Content {
|
|||||||
break
|
break
|
||||||
|
|
||||||
case "log":
|
case "log":
|
||||||
var input = this.createInput("button", menuKey, "{{.button.resetlogs}}")
|
var input = this.createInput("button", menuKey, "{{.button.resetLogs}}")
|
||||||
input.setAttribute("onclick", 'javascript: resetLogs();')
|
input.setAttribute("onclick", 'javascript: resetLogs();')
|
||||||
interaction.appendChild(input)
|
interaction.appendChild(input)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user