MPV Video Player
May 22, 2023 14:20:13 GMT 1
Post by alexfish on May 22, 2023 14:20:13 GMT 1
Hi All
Peter has Just Posted web app using iptv HERE
Here is terminal app ''video player' in bacon using libmpv
tested iptv to see if it would work with mpv
for iptv from the terminal , download in HOME dir
Normal usage is to pass args
when sorted uncoment the " IF (argc != 2) THEN"
and delete
The mpv.bac
Press q to quit
BR
Alex
Peter has Just Posted web app using iptv HERE
Here is terminal app ''video player' in bacon using libmpv
tested iptv to see if it would work with mpv
for iptv from the terminal , download in HOME dir
git clone https://github.com/iptv-org/iptv.git
Normal usage is to pass args
when sorted uncoment the " IF (argc != 2) THEN"
and delete
argv[1] = HOME$ & "/iptv/streams/uk_pluto.m3u"
The mpv.bac
PRAGMA INCLUDE <mpv/client.h>
PRAGMA OPTIONS `pkg-config --cflags mpv`
PRAGMA LDFLAGS `pkg-config --libs mpv`
OPTION PARSE FALSE
HOME$ = GETENVIRON$("HOME")
SUB PLAY()
END SUB
'static inline void check_error(int status)
SUB check_error(int status)
IF status < 0 THEN
PRINT "mpv API error: "
END
END IF
END SUB
/*
IF (argc != 2) THEN
printf("pass a single media file as argument\n");
END
END IF
*/
LOCAL ctx TYPE mpv_handle *
ctx = mpv_create()
IF NOT(ctx) THEN
PRINT "failed creating context\n"
END
END IF
LOCAL val
check_error(mpv_set_option_string(ctx, "input-default-bindings", "yes"))
mpv_set_option_string (ctx, "input-vo-keyboard", "yes")
val = 1
check_error(mpv_set_option(ctx, "osc", MPV_FORMAT_FLAG, &val))
check_error(mpv_initialize(ctx))
argv[1] = HOME$ & "/iptv/streams/uk_pluto.m3u"
LOCAL cmd[] = {"loadfile", argv[1], NULL} TYPE const char*
check_error(mpv_command(ctx, cmd))
'key q to quit
WHILE (1) DO
mpv_event *event = mpv_wait_event(ctx, 10000)
printf("event: %s\n", mpv_event_name(event->event_id))
IF (event->event_id == MPV_EVENT_SHUTDOWN) THEN
BREAK
END IF
WEND
mpv_terminate_destroy(ctx)
Press q to quit
BR
Alex