Split pos and size remember options. Default disable pos for all users.

This commit is contained in:
Ian Walton 2020-08-16 15:00:28 -04:00
parent 9e8ac67d10
commit 282dc4ef0d
3 changed files with 37 additions and 23 deletions

View File

@ -157,6 +157,27 @@ You can adjust the basic transcoder settings via the menu.
- `remote_direct_paths` - Apply this even when the server is detected as remote. Default: `false`
- `transcode_to_h265` - Allow the server to transcode media *to* `hevc`. Default: `false`
### Features
You can use the config file to enable and disable features.
- `fullscreen` - Fullscreen the player when starting playback. Default: `true`
- `enable_gui` - Enable the system tray icon and GUI features. Default: `true`
- `enable_osc` - Enable the MPV on-screen controller. Default: `true`
- It may be useful to disable this if you are using an external player that already provides a user interface.
- `media_key_seek` - Use the media next/prev keys to seek instead of skip episodes. Default: `false`
- `use_web_seek` - Use the seek times set in Jellyfin web for arrow key seek. Default: `false`
- `display_mirroring` - Enable webview-based display mirroring (content preview). Default: `false`
- `screenshot_menu` - Allow taking screenshots from menu. Default: `true`
- `check_updates` - Check for updates via GitHub. Default: `true`
- This requests the GitHub releases page and checks for a new version.
- Update checks are performed when playing media, once per day.
- `notify_updates` - Display update notification when playing media. Default: `true`
- Notification will only display once until the application is restarted.
- `discord_presence` - Enable Discord rich presence support. Default: `false`
- `menu_mouse` - Enable mouse support in the menu. Default: `true`
- This requires MPV to be compiled with lua support.
### Shell Command Triggers
You can execute shell commands on media state using the config file:
@ -277,35 +298,21 @@ need to.
- This could break if you use revert-seek markers or scripts that use it.
- `sync_osd_message` - Write syncplay status messages to OSD. Default: `true`
### Features
### Desktop Mode Settings
You can use the config file to enable and disable features.
These settings pertain to the "Desktop" (embedded webview) mode only.
- `fullscreen` - Fullscreen the player when starting playback. Default: `true`
- `enable_gui` - Enable the system tray icon and GUI features. Default: `true`
- `enable_osc` - Enable the MPV on-screen controller. Default: `true`
- It may be useful to disable this if you are using an external player that already provides a user interface.
- `media_key_seek` - Use the media next/prev keys to seek instead of skip episodes. Default: `false`
- `use_web_seek` - Use the seek times set in Jellyfin web for arrow key seek. Default: `false`
- `display_mirroring` - Enable webview-based display mirroring (content preview). Default: `false`
- `enable_desktop` - Use the desktop client. Default: `false`
- You can also use it by running the `jellyfin-mpv-desktop`.
- If you are using the Windows build, you must download the desktop version.
- `desktop_fullscreen` - Run the desktop client in fullscreen. Default: `false`
- `desktop_remember_pos` - Remember the position of the desktop client. Default: `false`
- `desktop_keep_loc` - Remember the position of the desktop client. Default: `false`
- This has been infamous for causing the window to be positioned off-screen.
- If you enable this and that happens, you can delete `layout.json` to fix it.
- `desktop_keep_size` - Remember the position of the desktop client. Default: `true`
- Set the window size, but not the position. Hopefully won't cause the client to open off-screen.
- `desktop_scale` - Allows changing the scale factor for the desktop app. Default: `1.0`
- This can be useful if you are on a platform that doesn't support HiDPI very well.
- `screenshot_menu` - Allow taking screenshots from menu. Default: `true`
- `check_updates` - Check for updates via GitHub. Default: `true`
- This requests the GitHub releases page and checks for a new version.
- Update checks are performed when playing media, once per day.
- `notify_updates` - Display update notification when playing media. Default: `true`
- Notification will only display once until the application is restarted.
- `discord_presence` - Enable Discord rich presence support. Default: `false`
- `menu_mouse` - Enable mouse support in the menu. Default: `true`
- This requires MPV to be compiled with lua support.
### Debugging

View File

@ -48,7 +48,8 @@ class Settings(object):
"mpv_log_level": "info",
"enable_desktop": False,
"desktop_fullscreen": False,
"desktop_remember_pos": False,
"desktop_keep_pos": False,
"desktop_keep_size": True,
"idle_when_paused": False,
"stop_idle": False,
"transcode_to_h265": False,

View File

@ -151,11 +151,17 @@ class WebviewClient(object):
self.server.start()
extra_options = {}
if os.path.exists(remember_layout) and settings.desktop_remember_pos:
if os.path.exists(remember_layout):
with open(remember_layout) as fh:
extra_options = json.load(fh)
layout_options = json.load(fh)
if settings.desktop_keep_loc and layout_options.get("x") and layout_options.get("y"):
extra_options["x"] = layout_options["x"]
extra_options["y"] = layout_options["y"]
if settings.desktop_keep_size and layout_options.get("width") and layout_options.get("height"):
extra_options["width"] = layout_options["width"]
extra_options["height"] = layout_options["height"]
else:
# Set a reasonable window size, with remember_pos disabled by default now.
# Set a reasonable window size
extra_options.update({
"width": 1280,
"height": 720