{"id":22859532,"url":"https://github.com/shadfin/desktop","last_synced_at":"2025-04-30T17:44:07.288Z","repository":{"id":264953020,"uuid":"885956867","full_name":"Shadfin/desktop","owner":"Shadfin","description":"A desktop version of Shadfin, with mpv player, built with wails (https://wails.io)","archived":false,"fork":false,"pushed_at":"2025-04-13T06:40:42.000Z","size":50357,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-13T07:36:18.100Z","etag":null,"topics":["go","golang","jellyfin-client","mpv","player","wails","wails-app"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shadfin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-09T20:47:58.000Z","updated_at":"2025-04-13T06:40:48.000Z","dependencies_parsed_at":"2024-12-23T02:38:21.769Z","dependency_job_id":null,"html_url":"https://github.com/Shadfin/desktop","commit_stats":null,"previous_names":["shadfin/desktop"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shadfin%2Fdesktop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shadfin%2Fdesktop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shadfin%2Fdesktop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shadfin%2Fdesktop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shadfin","download_url":"https://codeload.github.com/Shadfin/desktop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251753689,"owners_count":21638367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","jellyfin-client","mpv","player","wails","wails-app"],"created_at":"2024-12-13T09:07:15.707Z","updated_at":"2025-04-30T17:44:07.234Z","avatar_url":"https://github.com/Shadfin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shadfin \u003e\u003e Desktop\n\n**Windows only for now.**\n\nYou can either install via the [artifact in the workflow](https://github.com/Shadfin/desktop/actions), or by the [latest release published](https://github.com/Shadfin/desktop/releases).\n\nAdditional documentation will be provided in the future.\n\n\n# How it Works\n\nShadfin takes a different approach from typical apps or players that use MPV.\n\nInstead of having to use the same OpenGL context/buffer for both the webview and the video, we can use two completely separate contexts, or buffers. This eliminates issue pertaining to have and sync up the UI with the refresh rate of the content.\n\n## The Issue: Syncing the Frame\n\nThis has a major disadvantage, we have to ensure the webview and the player are synced up for one to render after the other.\n\nTypically this means we are stuck with syncing each frame of the webview with each frame of the player. \nHowever doing so causes the webview to feel noticeably slower.\n\nA video at 24fps will cause the webview to also run at 24 fps, not good! \n\n![frame-copy](https://github.com/user-attachments/assets/e671fd11-f826-49ca-8461-6b5f96eb96f9)\n\n### Solution 1: Don't sync the frames?\n\nWhile it may seem obvious this solution is not always guaranteed to work.\u003cbr\u003e\nWe are no longer ensuring the webview waits until the video frame has been rendered, this removes the guarantee we had before of the webview always rendering on top of the video content.\n\nThis not only disrupts the ability to use the webview it causes a noticeable flicker as the webview and player try to compete who gets to be on top.\n\nIf you've ever heard of \"Z-Fighting\" in game development this is essentially the same exact thing. We are wanting two things to be rendered at the same depth (or the Z cord) and they will fight each other to be on the top.\n\n![2017-10-04_22-53-10](https://github.com/user-attachments/assets/175c14cc-8cd4-4e4b-876c-994e3759e6f1)\n\n## Screw Sync - Maintain Order\n\nTurns out, we can have our cake and eat it too.\n\n**Why don't we just render two windows?**\n\nParent Window: Holds the actual player, and titlebar.\n\nChild Window: Holds the webview.\n\n\nTurns out this approach greatly reduces the complexity as well, sweet!\n\nIn Windows at least a parent window can have multiple child windows, that are rendered on top of the parent. This fixes the \"Z-Fighting\" explained before, we have the underlying window manager figure it out for us, which is *much* faster than doing it ourselves. \n\nAnd boom! A crazy fast native player with web controls!\n\n#### Whats the catch?\n\nTurns out windows is rather unique with supporting this, on MacOS theoretically this should also be supported with minimal hassle, but I've yet to test it.\n\nOn linux the story gets even more complicated. X11 being so old doesn't really support a use case like this, and Wayland doesn't really have the concepts of 'windows' anymore, so we're probably stuck falling back to syncing the frames. But who knows! Maybe we can get Linux to use two windows too!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadfin%2Fdesktop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadfin%2Fdesktop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadfin%2Fdesktop/lists"}