Play file in browser or with external helper application #34

Merged
prpr merged 14 commits from df/webif:df-playmedia-patch into master 2022-03-25 22:58:13 +00:00
2 changed files with 6 additions and 3 deletions
Showing only changes of commit 20c035873e - Show all commits

View File

@ -10,7 +10,7 @@ set urlbase [cgi_get base ""]
# Default to just downloading the raw file.
set url $file
set mime "video/ts"
set mime "video/mp2t"
if {[string match {*.ts} $file]} {
if {![catch {set ts [ts fetch $file]}]} {

View File

@ -269,7 +269,7 @@ proc {system dlnadb} {} {
}
proc {system _dlnaurl} {file urlbase} {
set mime "video/ts"
set mime "video/mp2t"
if {[catch {set db [sqlite3.open [system dlnadb]]}]} {
return {}
}
@ -278,7 +278,10 @@ proc {system _dlnaurl} {file urlbase} {
from tblresource join tblmedia using (mediaid)
where localurl = '%s'} $file]
if {[llength $muri]} {
lassign [lindex $muri 0] x mime x xuri
lassign [lindex $muri 0] x maybemime x xuri
if {$maybemime ne "video/ts"} {
set mime $maybemime
}
} else {
# Try for partially linked entry
set muri [$db query {