didl toevoegingen
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
@(require
|
||||
(for-label
|
||||
racket/base
|
||||
(file "../didl-lite.rkt")
|
||||
(file "../media-file-server.rkt")))
|
||||
|
||||
@title{Publishing Media Files}
|
||||
@@ -77,6 +78,26 @@ Removes the URL mapping. Requests that are already in progress may still
|
||||
finish.
|
||||
}
|
||||
|
||||
@defproc[(media-file-server-didl-lite
|
||||
[server media-file-server?]
|
||||
[url string?]
|
||||
[#:title title (or/c #f string?) #f]
|
||||
[#:duration duration (or/c #f nonnegative-real?) #f]
|
||||
[#:id id string? "0"]
|
||||
[#:parent-id parent-id string? "0"])
|
||||
string?]{
|
||||
|
||||
Returns DIDL-Lite metadata for a URL previously installed with
|
||||
@racket[media-file-server-publish!]. The MIME type, file size, and
|
||||
@tt{DLNA.ORG_OP=01} byte-range capability are taken from the actual
|
||||
publication. The file name is used as the title when @racket[title] is
|
||||
@racket[#f].
|
||||
|
||||
Pass the result as @racket[#:metadata] or @racket[#:next-metadata] to the
|
||||
media-renderer functions. Supplying the duration is recommended because some
|
||||
renderers use it when deciding whether time seeking is available.
|
||||
}
|
||||
|
||||
@defproc[(media-file-server-stop!
|
||||
[server media-file-server?])
|
||||
void?]{
|
||||
@@ -104,10 +125,26 @@ Stops the web server. Repeated calls have no effect.
|
||||
"C:/muziek/second.flac"
|
||||
"second.flac"))
|
||||
|
||||
(define first-metadata
|
||||
(media-file-server-didl-lite
|
||||
files
|
||||
first-uri
|
||||
#:title "First track"
|
||||
#:duration 639))
|
||||
|
||||
(define second-metadata
|
||||
(media-file-server-didl-lite
|
||||
files
|
||||
second-uri
|
||||
#:title "Second track"
|
||||
#:duration 242))
|
||||
|
||||
(media-renderer-play-uri!
|
||||
renderer
|
||||
first-uri
|
||||
#:next-uri second-uri)
|
||||
#:metadata first-metadata
|
||||
#:next-uri second-uri
|
||||
#:next-metadata second-metadata)
|
||||
]
|
||||
|
||||
Keep the URLs published until the renderer has finished reading them.
|
||||
|
||||
Reference in New Issue
Block a user