5.4.5.1 Beta

This commit is contained in:
Frank Skare
2020-05-03 11:10:56 +02:00
parent e1bd44cd00
commit 28045ad33e
46 changed files with 1090 additions and 829 deletions

View File

@@ -0,0 +1,35 @@
// When seeking displays position and duration like so: 70:00 / 80:00
// Which is different from most players which use: 01:10:00 / 01:20:00
// In input.conf set the input command prefix no-osd infront of the seek command.
function add_zero(val)
{
val = Math.round(val);
return val > 9 ? "" + val : "0" + val;
}
function format(val)
{
var sec = Math.round(val);
if (sec < 0)
sec = 0;
pos_min_floor = Math.floor(sec / 60);
sec_rest = sec - pos_min_floor * 60;
return add_zero(pos_min_floor) + ":" + add_zero(sec_rest);
}
function on_seek(_)
{
pos = mp.get_property_number("time-pos");
dur = mp.get_property_number("duration");
if (pos > dur)
pos = dur;
mp.commandv("show-text", format(pos) + " / " + format(dur));
}
mp.register_event("seek", on_seek);

View File

@@ -0,0 +1,26 @@
// This script shows the playlist.
function showPlaylist()
{
// set font size
mp.set_property_number("osd-font-size", 40);
// show playlist for 5 seconds
mp.command("show-text ${playlist} 5000");
// restore original font size in 6 seconds
setTimeout(resetFontSize, 6000);
}
// restore original font size
function resetFontSize()
{
mp.set_property_number("osd-font-size", size);
}
// save original font size
var size = mp.get_property_number("osd-font-size");
// input.conf: key script-binding show-playlist
mp.add_key_binding(null, "show-playlist", showPlaylist);