Fixed mpv youtube-quality script
This commit is contained in:
parent
8a92a9c488
commit
da3b812e71
1 changed files with 6 additions and 5 deletions
|
@ -112,7 +112,7 @@ function show_menu()
|
||||||
draw_menu()
|
draw_menu()
|
||||||
end
|
end
|
||||||
function choose_prefix(i)
|
function choose_prefix(i)
|
||||||
if i == selected and i == active then return opts.selected_and_active
|
if i == selected and i == active then return opts.selected_and_active
|
||||||
elseif i == selected then return opts.selected_and_inactive end
|
elseif i == selected then return opts.selected_and_inactive end
|
||||||
|
|
||||||
if i ~= selected and i == active then return opts.unselected_and_active
|
if i ~= selected and i == active then return opts.unselected_and_active
|
||||||
|
@ -157,7 +157,7 @@ function show_menu()
|
||||||
mp.add_forced_key_binding(opts.toggle_menu_binding, "escape", destroy)
|
mp.add_forced_key_binding(opts.toggle_menu_binding, "escape", destroy)
|
||||||
|
|
||||||
draw_menu()
|
draw_menu()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local ytdl = {
|
local ytdl = {
|
||||||
|
@ -186,7 +186,7 @@ function download_formats()
|
||||||
url = string.gsub(url, "ytdl://", "") -- Strip possible ytdl:// prefix.
|
url = string.gsub(url, "ytdl://", "") -- Strip possible ytdl:// prefix.
|
||||||
|
|
||||||
-- don't fetch the format list if we already have it
|
-- don't fetch the format list if we already have it
|
||||||
if format_cache[url] ~= nil then
|
if format_cache[url] ~= nil then
|
||||||
local res = format_cache[url]
|
local res = format_cache[url]
|
||||||
return res, table_size(res)
|
return res, table_size(res)
|
||||||
end
|
end
|
||||||
|
@ -240,7 +240,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
-- register script message to show menu
|
-- register script message to show menu
|
||||||
mp.register_script_message("toggle-quality-menu",
|
mp.register_script_message("toggle-quality-menu",
|
||||||
function()
|
function()
|
||||||
if destroyer ~= nil then
|
if destroyer ~= nil then
|
||||||
destroyer()
|
destroyer()
|
||||||
|
@ -258,7 +258,8 @@ function reload_resume()
|
||||||
local reload_duration = mp.get_property_native("duration")
|
local reload_duration = mp.get_property_native("duration")
|
||||||
local time_pos = mp.get_property("time-pos")
|
local time_pos = mp.get_property("time-pos")
|
||||||
|
|
||||||
mp.set_property_number("playlist-pos", playlist_pos)
|
--mp.set_property_number("playlist-pos", playlist_pos)
|
||||||
|
mp.commandv("playlist-play-index", playlist_pos)
|
||||||
|
|
||||||
-- Tries to determine live stream vs. pre-recordered VOD. VOD has non-zero
|
-- Tries to determine live stream vs. pre-recordered VOD. VOD has non-zero
|
||||||
-- duration property. When reloading VOD, to keep the current time position
|
-- duration property. When reloading VOD, to keep the current time position
|
||||||
|
|
Loading…
Add table
Reference in a new issue