-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: Migrating to Capacitor #101
Comments
I found this project today and I wondered why it chose Cordova instead of Capacitor. |
There is no reason. I wasn't aware of capacitor's existence when I started this fork. Now, that I am aware of it, I do admit that it would provide a better workflow, but the reason I haven't just moved forward with migrating to capacitor is because A. I haven't had a lot of time to dedicate to FreeTube lately and B. I'm worried about spending time migrating to capacitor just to turn around and migrate to Tauri when 2.0 is officially released. I already have a desktop FreeTubeTauri POC which I haven't really told anyone about because I didn't want to stretch myself thin between two forks of the same project. All in all, I have no idea when Tauri 2.0 will be officially released, so maybe, I should just take a weekend and migrate to capacitor for the time being. IDK🤷♀️. I've been thinking about it. |
I explored capacitor as a solution, and my takeaway was, after setting everything up, I found it would be just as easy to just create a blank Android Studio project with a webview in it. Furthermore, some of the capacitor plugins this project would need do not fully work. For instance, the capacitor http plugin only handles full downloads of videos. It cannot handle video streaming. This is because capacitor overrides fetch with its own version which requires the entire response be loaded into memory before responding. the future of FreeTubeCordovaI have decided to just rewrite the JavaScript interface for android myself. Cordova is being gutted from the project, and it is being replaced with a proper android studio project. Some immediate benefits of this solution are local api streaming (#5). It just works out of the box now. I don't know what to say other than there is a setting that makes webviews behave like they do in electron (no need for CORS), but neither capacitor nor cordova seem to readily expose this. I assume this is because they rely on the webapp being served from Another immediate benefit would be Background Play. In cordova, the way I was accomplishing background play was by pressing play on the video as soon as it paused in the background. This was hacky and had the effect of causing the video to stutter before going into the background. In this new version I am working on, I simply override the function that pauses the video in the background. Suddenly, background play is more consistent than ever. I have found that being able to write my own kotlin rather than relying on plugins allows me to get more out of Android. For instance, the media controls plugin is fine, but it doesn't expose methods for changing the media notification progress and listening to seek events. When writing that code myself, I was easily able to just create a new media session, attach all the metadata and listen to those events. I just wanted to state what was happening with the project, and this seems like the issue for that. I realize I am not always on top of getting changes out there, so idk when this new version will be ready to release. |
If anyone is interested in trying out the new, cordova-less, and incomplete version I am working on, I got CI working: https://github.com/MarmadileManteater/FreeTubeCordova/actions/runs/7769115251 This should just install over typical nightly, and if you updated to at least |
Will close this issue as the app will be using webview instead |
##### ~~Cordova~~ Android specific changes: - Switched away from Cordova [#101](#101 (comment)) - Added ability to stream videos **locally** *without* proxying through invidious [#5](#5) 🥂 - Added ability to seek in the media controls notification - Fixed videos stopping or stuttering when the app enters the background [#10](#10) - Fixed YT links not opening in app [#264](#264) - Added ability to change where profiles/settings/playlists/history.db are located on the filesystem [#299](#299) - Fullscreen videos now take up the entire screen instead of sharing real estate with the system UI This release includes all of the changes from upstream release [0.20.0](https://github.com/FreeTubeApp/FreeTube/releases/tag/v0.20.0-beta). ... **Full Changelog**: 0.19.2.110...0.20.0.111
##### ~~Cordova~~ Android specific changes: - Switched away from Cordova [#101](#101 (comment)) - Added ability to stream videos **locally** *without* proxying through invidious [#5](#5) 🥂 - Added ability to seek in the media controls notification - Fixed videos stopping or stuttering when the app enters the background [#10](#10) - Fixed YT links not opening in app [#264](#264) - Added ability to change where profiles/settings/playlists/history.db are located on the filesystem [#299](#299) - Fullscreen videos now take up the entire screen instead of sharing real estate with the system UI This release includes all of the changes from upstream release [0.20.0](https://github.com/FreeTubeApp/FreeTube/releases/tag/v0.20.0-beta). ... **Full Changelog**: 0.19.2.110...0.20.0.111
##### ~~Cordova~~ Android specific changes: - Switched away from Cordova [#101](#101 (comment)) - Added ability to stream videos **locally** *without* proxying through invidious [#5](#5) 🥂 - Added ability to seek in the media controls notification - Fixed videos stopping or stuttering when the app enters the background [#10](#10) - Fixed YT links not opening in app [#264](#264) - Added ability to change where profiles/settings/playlists/history.db are located on the filesystem [#299](#299) - Fullscreen videos now take up the entire screen instead of sharing real estate with the system UI This release includes all of the changes from upstream release [0.20.0](https://github.com/FreeTubeApp/FreeTube/releases/tag/v0.20.0-beta). ... **Full Changelog**: 0.19.2.110...0.20.0.113
##### ~~Cordova~~ Android specific changes: - Switched away from Cordova [#101](#101 (comment)) - Added ability to stream videos **locally** *without* proxying through invidious [#5](#5) 🥂 - Added ability to seek in the media controls notification - Fixed videos stopping or stuttering when the app enters the background [#10](#10) - Fixed YT links not opening in app [#264](#264) - Added ability to change where profiles/settings/playlists/history.db are located on the filesystem [#299](#299) - Fullscreen videos now take up the entire screen instead of sharing real estate with the system UI This release includes all of the changes from upstream release [0.20.0](https://github.com/FreeTubeApp/FreeTube/releases/tag/v0.20.0-beta). ... **Full Changelog**: 0.19.2.110...0.20.0.114
##### ~~Cordova~~ Android specific changes: - Switched away from Cordova [#101](#101 (comment)) - Added ability to stream videos **locally** *without* proxying through invidious [#5](#5) 🥂 - Added ability to seek in the media controls notification - Fixed videos stopping or stuttering when the app enters the background [#10](#10) - Fixed YT links not opening in app [#264](#264) - Added ability to change where profiles/settings/playlists/history.db are located on the filesystem [#299](#299) - Fullscreen videos now take up the entire screen instead of sharing real estate with the system UI This release includes all of the changes from upstream release [0.20.0](https://github.com/FreeTubeApp/FreeTube/releases/tag/v0.20.0-beta). ... **Full Changelog**: 0.19.2.110...0.20.0.115
Topic
Discussion
I haven't done too much research but it seems like Capacitor is a popular alternative to Cordova that has backwards compatibility support for Cordova plugins and seems to have a more active plugin community. So, I created this discussion to discuss whether it'd be worth it to migrate and to help determine the amount of effort that would go into the migration.
https://capacitorjs.com/docs/cordova#differences-between-capacitor-and-cordova
Migration guide:
https://capacitorjs.com/docs/cordova/migration-strategy
https://capacitorjs.com/docs/cordova/migrating-from-cordova-to-capacitor
Some plugins:
Music controls: https://github.com/ingageco/capacitor-music-controls-plugin-v3
https://github.com/riderx/awesome-capacitor
The text was updated successfully, but these errors were encountered: