diff options
author | Sebastian Mayr <sebastian.mayr@student.uibk.ac.at> | 2015-04-03 19:04:31 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-09 20:36:38 +0200 |
commit | c4faab48714e6597cb12abe7be4aada694bac897 (patch) | |
tree | e239763340446b6ba469925bfe438da102e1376f /player | |
parent | 843bc822a8a7974c7fbeea62525cb56bbab23fde (diff) | |
download | mpv-c4faab48714e6597cb12abe7be4aada694bac897.tar.bz2 mpv-c4faab48714e6597cb12abe7be4aada694bac897.tar.xz |
ytdl: set additional properties for rtmp streams
Diffstat (limited to 'player')
-rw-r--r-- | player/lua/ytdl_hook.lua | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index c3a48941c3..508c43f543 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -37,6 +37,20 @@ local function set_http_headers(http_headers) end end +local function append_rtmp_prop(props, name, value) + if not name or not value then + return props + end + + if props and props ~= "" then + props = props.."," + else + props = "" + end + + return props..name.."=\""..value.."\"" +end + mp.add_hook("on_load", 10, function () local url = mp.get_property("stream-open-filename") @@ -241,9 +255,13 @@ mp.add_hook("on_load", 10, function () -- for rtmp if not (json.play_path == nil) then - mp.set_property("file-local-options/stream-lavf-o", - "rtmp_tcurl=\""..streamurl.. - "\",rtmp_playpath=\""..json.play_path.."\"") + local rtmp_prop = append_rtmp_prop(nil, "rtmp_tcurl", streamurl) + rtmp_prop = append_rtmp_prop(rtmp_prop, "rtmp_pageurl", json.page_url) + rtmp_prop = append_rtmp_prop(rtmp_prop, "rtmp_playpath", json.play_path) + rtmp_prop = append_rtmp_prop(rtmp_prop, "rtmp_swfverify", json.player_url) + rtmp_prop = append_rtmp_prop(rtmp_prop, "rtmp_app", json.app) + + mp.set_property("file-local-options/stream-lavf-o", rtmp_prop) end end end |