From 5df562dbadb762ee66a09fdd633a44d0fc1c1260 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 20 May 2025 07:50:24 -0700 Subject: ability to play movie trailers from youtube --- main.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 7d62c3b..09b0936 100644 --- a/main.lua +++ b/main.lua @@ -842,7 +842,9 @@ local function play_stream(stream) -- add a per-file option containing the stream id, allowing it to be -- retrieved when a start-file event is received local url - if stream.stream_type == 'series' then + if stream.stream_url then + url = stream.stream_url + elseif stream.stream_type == 'series' then url = xc_server .. '/series/' .. xc_user .. '/' .. xc_pass .. '/' .. stream.stream_id .. '.vod' else @@ -1077,6 +1079,17 @@ local function open_option_movie_info(opt) end end + if info.youtube_trailer and info.youtube_trailer ~= '' then + local url = 'https://youtu.be/' .. info.youtube_trailer + options[#options+1] = {name=' '} + options[#options+1] = { + name='Trailer: ' .. url, + type='stream', + id='youtube:' .. info.youtube_trailer, + stream_url=url, + } + end + local m = { options=options, title='Movie Info: ' .. opt.name, -- cgit v1.2.3-70-g09d2