summaryrefslogtreecommitdiffstats
path: root/player/lua
Commit message (Collapse)AuthorAgeFilesLines
* osc: bottombar/topbar: make chapter markers slightly biggerRicardo Constantino2016-12-251-17/+18
| | | | | | | 1px squares to 2px triangles and layout=box markers from 1px squares to 2x1px rectangles. While we're at it, wrap a few lines to 80col again.
* osc: replace length property with durationpavelxdd2016-12-041-1/+1
| | | | | | Length property is deprecated and no longer works. This fixes a bug when the total file duration wasn't visible if the option to display milliseconds was activated.
* osc: don't hide playlist buttons, just disableRicardo Constantino2016-12-021-5/+6
| | | | | | | | Having empty space before the title in layout=*bar looks worse than the floating buttons in layout=box. Also disable both playlist buttons selectively according to the current position.
* osc: topbar: use same styles as bottombarRicardo Constantino2016-12-021-13/+13
|
* osc: fix use of deprecated idle propertyRicardo Constantino2016-11-221-1/+1
| | | | Fixes regression since 7201fd7d
* client API: turn mpv_suspend() and mpv_resume() into stubswm42016-11-221-6/+6
| | | | | | | | | | | As threatened by the API changes document. This commit also removes or stubs equivalent calls in IPC and Lua scripting. The stubs are left to maintain ABI compatibility. The semantics of the API functions have been close enough to doing nothing that this probably won't even break existing API users. Probably.
* osc: fix possible race condition in right timecodeRicardo Constantino2016-11-211-2/+1
|
* ytdl_hook: sort chapters by timeRicardo Constantino2016-11-151-1/+1
| | | | | mpv doesn't work well with unordered chapters. ex: https://youtu.be/DIKPUL6b4N8
* osc: add seekbarstyle=knobRicardo Constantino2016-11-091-4/+16
| | | | | | | | Most code from @leiserfg in #2365. Closes #2365 Cut guides to the center of the knob. This makes the knob knob look more like IRL knob sliders.
* osc: fix crashes when dragging seekbar across file changesRicardo Constantino2016-11-081-2/+3
| | | | Fixes #3210
* osc: slimbox: fix clipping with seekbarstyle=barRicardo Constantino2016-11-071-1/+3
| | | | Fixes #3737
* osc: add alpha animation to tooltipRicardo Constantino2016-10-311-1/+14
| | | | | Fixes lingering tooltip with full alpha if mouse leaves window with OSC still active.
* osc: top/bottombar: rescale layout to same size with scale=1Ricardo Constantino2016-10-291-49/+53
| | | | | Basically, there's two less values to revert to previous defaults and top/bottombar now look at scale=1 like they looked with scale=1.5.
* osc: top/bottombar: scale title if too large like boxRicardo Constantino2016-10-291-14/+24
|
* osc: compromise on default deadzonesizeRicardo Constantino2016-10-291-2/+2
| | | | | | This way people can still use the mouse to quickly check the elapsed time without moving it all the way to the bottom while still having half the screen to ignore mouse movement.
* osc: don't wrap the titleRicardo Constantino2016-10-291-1/+1
|
* osc: top/bottombar: also scale when min-width is reachedRicardo Constantino2016-10-291-12/+34
| | | | Same behavior as box/slimbox.
* osc: top/bottombar: dynamically size timecodes according to timemsRicardo Constantino2016-10-291-9/+14
|
* osc: fix missing chapter ticks with seekbarstyle=barRicardo Constantino2016-10-291-0/+1
|
* osc: fix crash with no chaptersRicardo Constantino2016-10-251-4/+4
| | | | Also, chapter position which wasn't changed to work with 1-based.
* osc: Fix and simplify limited_listMiroslav Koskar2016-10-251-28/+25
| | | | | | | | | | | * Fixes: when on the end of playlist only half of entries are displayed. * Simplifies the logic of limited_list so it's easy to follow. * limited_list's pos parameter is now 1 based which seem more natural. * Few changes to comply with code style thorough the file. * Small format change: "Playlist: (%d/%d):" -> "Playlist [%d/%d]:" "Chapters: (%d/%d):" -> "Chapters [%d/%d]:"
* osc: add script message handlers for chapter/track/playlistsRicardo Constantino2016-10-241-0/+13
| | | | | | | | | | These can be used in input.conf for pretty formatting of lists as with shift+clicking the OSC buttons. Ex: z script-message osc-playlist Z script-message osc-chapterlist x script-message osc-tracklist
* osc: fix crash after reaching a certain position in limited listsRicardo Constantino2016-10-201-1/+1
| | | | | Don't try to display more items than there are in the chapter/playlist. Fixes #3691
* osc: use the same characters as track list for playlist/chapterRicardo Constantino2016-10-171-10/+4
| | | | | | | | | Had only tested with luajit which supports the \xHH syntax added in Lua 5.2. The arrow is troublesome to use since the ideal way to use it, as the OSD code uses it, needs \alpha&H00<arrow>\r to work, which does not in OSC's way of showing messages.
* osc: fix chapter/playlist listing if emptyRicardo Constantino2016-10-151-1/+1
|
* osc: show playlist/chapter list on prev/next instead of osdRicardo Constantino2016-10-151-4/+16
|
* osc: fix listing of chapters and playlistRicardo Constantino2016-10-151-10/+87
| | | | | | | Fixes regression since 05c398f. Add helper functions for limiting potentially huge lists of playlists and chapters and use them.
* osc: fix display of chapters and playlist scalingRicardo Constantino2016-10-151-2/+11
| | | | Compensate \fs when using non-default scale(fullscreen|windowed).
* osc: add user-alterable margin for top/bottombarRicardo Constantino2016-10-151-5/+6
|
* osc: add right-click behavior to playlist and chapter buttonsRicardo Constantino2016-10-151-0/+8
|
* osc: change default layout to bottombarRicardo Constantino2016-10-151-6/+6
| | | | | | Change a few other defaults accordingly: - seekbarstyle=bar looks better with bottombar. - Bigger scalewindowed and scalefullscreen make bottom/topbar more readable.
* ytdl_hook: Add title to playlist items if availableRicardo Constantino2016-10-151-0/+6
|
* osc: move tooltip to inside seekbar for top/bottombarRicardo Constantino2016-10-071-25/+28
| | | | Tooltip border is user-alterable
* osc: change seekbar background's alpha scalingRicardo Constantino2016-10-071-2/+4
| | | | | | This avoids a full transparent seekbar with only boxalpha=115. No change with default values.
* osc: align text vertically in top/bottombarRicardo Constantino2016-10-071-32/+39
| | | | Close #2093
* ytdl_hook: add chapters by parsing video's descriptionMaurycy Skier2016-10-061-0/+46
|
* ytdl_hook: Set aspect ratio for anamorphic videoRicardo Constantino2016-09-281-0/+6
|
* osc: Fix scaling issues when toggling fullscreenRicardo Constantino2016-09-251-0/+1
| | | | Fixes #3429
* ytdl_hook: temporarily force disable dash segments formatsRicardo Constantino2016-09-221-4/+5
|
* lua: add API for registering idle handlerswm42016-09-211-0/+10
| | | | | This is only a functionality the Lua event dispatcher provides, rather than the libmpv client API.
* lua: run timers only after draining the event queuewm42016-09-211-12/+11
| | | | | | Instead of rechecking the timers every time after an event is read, do it only once the event queue is empty. This is probably slightly more efficient, and facilitates the next commit.
* ytdl_hook: don't bother adding subtitles if duration isn't knownRicardo Constantino2016-09-131-5/+3
| | | | EDL doesn't work with subtitles with unknown length.
* ytdl_hook: Support playlist entries without subtitlesRicardo Constantino2016-09-131-3/+17
| | | | | | | | | | | | | Fixes missing subtitle tracks if the first entry didn't have any. Previously it just checked for the first entry in the playlist for requested languages and if that entry happened to not have subtitles they also wouldn't show up for the other entries. It will skip languages if the first entry with subs has less or different languages than the others. Unrelated to http_dash_segments.
* player: fix minor spelling mistake in osc.luaJames Cowgill2016-08-271-1/+1
| | | | | Lintain (https://lintian.debian.org/) complains about this particular spelling mistake.
* ytdl: Error out with http_dash_segmentsRicardo Constantino2016-07-301-0/+4
| | | | Unsupported for now.
* Use - as command-name separator everywhereTimotej Lazar2016-07-142-7/+7
| | | | | | | Old-style commands using _ as separator (e.g. show_progress) were still used in some places, including documentation and configuration files. This commit updates all such instances to the new style (show-progress) so that commands are easier to find in the manual.
* ytdl: fix brightcove urlsRicardo Constantino2016-05-301-3/+5
|
* ytdl_hook: support multi-arc subtitlesRicardo Constantino2016-05-231-1/+20
| | | | While at it, pass durations of segments from ytdl if available.
* lua: add timer:is_enabled() functionJulian2016-05-141-0/+4
| | | | | Allows to query if some timer is currently running or was stopped/killed.
* ytdl_hook: Just check if protocol is rtmpRicardo Constantino2016-05-141-1/+1
| | | | Partial fix to #3090
* lua: don't require key for mp.add_key_binding()wm42016-03-261-3/+4
| | | | | Requested. The intention is that scripts can provide mappable actions for key bindings without setting a default key.
* lua: don't suspend core by default during script executionwm42016-03-181-1/+1
| | | | | | | | | This changes behavior somewhat. The old behavior can be restored by running "mp.use_suspend=true". It was originally introduced for the OSC, but I can't reproduce whatever misbehavior I was seeing. (See mp.suspend()/resume() for explanations what the suspend mechanism does.)
* ytdl_hook: handle optional format_note▟ ▖▟ ▖2016-03-101-1/+1
| | | | | some extractors don't return a format_note for their audio stream which resulted in commandv complaining "argument 4 is not a string" (got nil).
* osc: fix mouse areaswm42016-03-081-1/+1
| | | | | | | | The scaling was the wrong way around, and the section name was missing. Regression since commit 5fa45fb5. Fixes #2916.
* osd, lua: remove weird OSD scalingwm42016-03-071-9/+30
| | | | | | | | | | | | | | | | | | | | | Do not scale OSD mouse input to the ASS OSD script resolution. The original idea of this mechanism was that the user doesn't have to care about the actual resolution of anything, and can just use the OSD resolution consistently. But this made things worse. Remove the implicit scaling, and always use the screen resolution. (Except with --vo=xv, where additional scaling is forced upon everything.) Drop get_osd_resolution(). There is no replacement. Rename get_screen_size() and get_screen_margins() to use "osd" instead of "screen". For anything but --vo=xv these are equivalent, but with --vo=xv the OSD resolution has additional implicit scaling. Add code to osc.lua which emulates the old behavior. Note that none of the changed functions were public API, so implicit breakage of scripts which used it is just going to happen.
* osc: add always-on mode and unify visibility mode (always/never/auto)Avi Halachmi (:avih)2016-02-271-6/+61
| | | | | | | | | | | | | Adds always-on mode by internally utilizing hidetimeout as negative and forbidding the user to set negative values. This removes script-message to enable/disable the osc, and instead introduces a combined 'visibility' control with the values never/auto/always. It's available via script_opts and script_message as 'osc-visibility'. As message, it also supports a 'cycle' value. The del key is bound to cycling the visibility modes.
* osc: fix runtime enable_osc(true/false)Avi Halachmi (:avih)2016-02-271-4/+11
| | | | | | | | | | | There were few issues: - When it's disabled and then enabled, it was displaying the osc briefly and then autohide right away. Don't do that. - When it's enabled and then disabled, it was not removing the osc from screen if called while the osc is visible (because tick() is responsible for the hide but it doesn't render() the empty osc when the osc is disabled). - Due to delayed/async unbinding of mouse events it was possible to show_osc() after it got disabled e.g. from mouse_move. Prevent this.
* ytdl: Include Referer header as wellYen Chi Hsuan2016-01-101-3/+6
| | | | | Some videos require correct Referer header for downloading, or 403 Forbidden is thrown.
* ytdl: disable --all-subs if "sub-lang" is in raw-optionsRicardo Constantino2015-10-241-1/+9
| | | | | | Defaults stay the same (--all-subs is used if sub-lang wasn't used.) Don't forget to also add "write-sub=" if using sub-lang or else it won't work.
* ytdl: Set a proper label for external audio tracksChrisK22015-10-111-3/+3
|
* ytdl: Remove DASH hacks, use DASH by defaultChrisK22015-10-111-10/+12
| | | | | | | | | | | Thanks to rcombs, ffmpeg now properly supports DASH and we can remove our hacks for it and use it by default whenever available. If you don't like this for whatever reason, you can get the "normal" streams back with --ytdl-format=best . Closes #579 Closes #1321 Closes #2359
* ytdl: Remove version check and minor cleanupChrisK22015-10-061-55/+22
| | | | Closes #2370
* ytdl: Don't override user-set format in no-video modeChrisK22015-09-301-11/+23
|
* osc: reinit on playlist changesKevin Mitchell2015-08-291-0/+1
| | | | | | This takes care of the corner case where the player is started with a single playlist entry so that the next/prev arrows are greyed out, but remain that way even after new elements are added to the playlist.
* osc: exit tick immediately if disabled.torque2015-08-281-0/+2
| | | | | | | | | | | Even after it has been disabled with the `disable-osc` message, the OSC continues to run the tick function. Completely preventing tick from being called is impractical since there are several different places that it's called in the code, so just make it immediately return if the OSC has been disabled. This prevents the OSC from continuing the clear the OSD on every tick, allowing other scripts to disable it so that they may draw to the OSD.
* ytdl: catch bogous extractor infoChrisK22015-08-271-12/+12
| | | | | | | Some extractors may claim to have extracted subtitles, but then set the relevant fields to null. Try to catch those cases. Fixes #2254
* osc: avoid annoying verbose mode log spamwm42015-08-101-6/+22
| | | | | | | | enable_key_bindings()/disable_key_bindings() now prints a log message on each call, thus we should avoid makign redundant calls. This could probably be solved more elegantly, but since this is all legacy/private API, don't bother.
* lua: implement input_enable_section/input_disable_section via commandswm42015-08-062-2/+13
| | | | | | | | | | | | | | | Removes some more internal API calls from the Lua scripting backend. Which is good, because ideally the scripting backend would use libmpv functions only. One awkwardness is that mouse sections are still not supported by the public commands (and probably will never), so flags like allow-hide- cursor make no sense to an outside user. Also, the way flags are passed to the Lua function changes. But that's ok, because they're only undocumented internal functions, and not supposed to be used by script users. osc.lua only does due to historical reasons.
* lua: make mp.input_define_section use the define-section commandwm42015-08-061-0/+7
|
* osc: completely disable if no VO window existswm42015-08-041-1/+7
| | | | | Fixes relatively excessive CPU usage when paused while playing audio only.
* player: remove higher-level remains of DVD/BD menu supportwm42015-08-031-9/+0
| | | | | | | | | | | | | | | Nobody wanted to restore this, so it gets the boot. If anyone still wants to volunteer to restore menu support, this would be welcome. (I might even try it myself if I feel masochistic and like wasting a lot of time for nothing.) But if it does get restored, it should be done differently. There were many stupid things about how it was done. For example, it somehow tried to pull mp_nav_events through all the layers (including needing to "buffer" them in the demuxer), which was needlessly complicated. It could be done simpler. This code was already inactive, so this commit actually changes nothing. Also keep in mind that normal DVD/BD playback still works.
* ytdl: get start_timeRicardo Constantino2015-07-291-0/+6
|
* ytdl: print command in debug modeRicardo Constantino2015-07-291-0/+1
|
* ytdl: don't print failure warning when youtube-dl was killed by uswm42015-06-271-3/+5
|
* osc: time display configuration optionsTeoh Han Hui2015-06-191-2/+4
| | | | Total time and ms
* ytdl_hook: Support 'multi_video' resultsJaime Marquínez Ferrándiz2015-06-071-1/+1
| | | | | They can be handled by the same codes used for playlists, most of them will use an EDL. Fixes #2027.