Code Monkey home page Code Monkey logo

mpv-reload's Introduction

reload.lua

When an online video is stuck during buffering or got slow CDN source, restarting often helps. This script provides automatic reloading of videos that didn't have buffering progress for some time, keeping the current time position while preserving entries in the playlist. It also adds Ctrl+r keybinding to reload video manually.

Install

Mpv reads its configuration from MPV_HOME directory. On Unix it is ~/.config/mpv, see files section of the manual for the Windows configuration files.

To install the script, copy reload.lua to the MPV_HOME/scripts directory. To override default settings, create reload.conf file in the lua-settings directory MPV_HOME/lua-settings.

NOTE: config file name should match the name of the script.

For configuration example you can also check 4e6/dotfiles repo.

Settings

Default reload.conf settings:

# enable automatic reload on timeout
# when paused-for-cache event fired, we will wait
# paused_for_cache_timer_timeout sedonds and then reload the video
paused_for_cache_timer_enabled=yes

# checking paused_for_cache property interval in seconds,
# can not be less than 0.05 (50 ms)
paused_for_cache_timer_interval=1

# time in seconds to wait until reload
paused_for_cache_timer_timeout=10

# enable automatic reload based on demuxer cache
# if demuxer-cache-time property didn't change in demuxer_cache_timer_timeout
# time interval, the video will be reloaded as soon as demuxer cache depleated
demuxer_cache_timer_enabled=yes

# checking demuxer-cache-time property interval in seconds,
# can not be less than 0.05 (50 ms)
demuxer_cache_timer_interval=2

# if demuxer cache didn't receive any data during demuxer_cache_timer_timeout
# we decide that it has no progress and will reload the stream when
# paused_for_cache event happens
demuxer_cache_timer_timeout=20

# when the end-of-file is reached, reload the stream to check
# if there is more content available.
reload_eof_enabled=no

# keybinding to reload stream from current time position
# you can disable keybinding by setting it to empty value
# reload_key_binding=
reload_key_binding=Ctrl+r

Debugging

Debug messages will be printed to stdout with mpv command line option --msg-level='reload=debug'

mpv-reload's People

Contributors

4e6 avatar woorst avatar zhengqunkoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.