Skip to content

Configure seek bar to use bottom bar OSD #124

Closed
@jakeogh

Description

@jakeogh

I'm trying to make the LEFT/RIGHT seek bar use the nice new bottom bar OSD/OSC(?). This example has the bottom bar if it's moused-over, but hitting LEFT/RIGHT draws the seek bar in the middle of the video instead of using the bottombar. Using git-latest.

#!/usr/bin/env python3

import sys
import mpv


def logger(loglevel, component, message):
    print('[{}] {}: {}'.format(loglevel, component, message), file=sys.stderr)


def play(media):
    print("play('{}')".format(media), file=sys.stderr)

    player = mpv.MPV(ytdl=True,
                     log_handler=logger,
                     input_default_bindings=True,
                     input_vo_keyboard=True,
                     terminal=True,
                     input_terminal=True,
                     script_opts='osc-layout=bottombar,osc-seekbarstyle=bar',
                     osc=True)

    player.on_key_press('ESC')(player.quit)
    player.on_key_press('ENTER')(lambda: player.playlist_next(mode='force'))

    try:
        for item in media:
            player.play(item)
            player.wait_for_playback()
    except mpv.ShutdownError:
        pass

    player.terminate()

if __name__ == '__main__':
    play(media=['test.mkv'])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions