-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Feature Request]: Make Local API work in Cordova #5
Comments
Reading back through my issues, I should also note that there is no real way to fix this issue in the PWA without standing up a server. |
I hit another wall with this. I was able to make a proof of concept using the Cordova Advanced HTTP plugin. The issue that completely halted my progress had to do with the |
This issue is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
There is a setting for proxying videos through invidious regardless of api preference that you could force to be true if that's the only thing that you had issues with |
This implementation maps the fetch function used by YouTube.js to the `cordova-advanced-http-plugin`. This is related to #5.
- Add `IS_ELECTRON` checks before accessing the filesystem - Allow Local API to be used when `IS_CORDOVA` or `IS_ELECTRON` This is related to #5.
I've made some major progress on this. Since the switch to YouTube.js upstream, I was able to simply override the
As far as streaming videos is concerned, it is correct that the setting for proxying videos through invidious does work, but I also have made a breakthrough. I have figured out how to asynchronously fetch videos (using the Cordova advanced http plugin) and feed the resulting blob URL back to the video tag. Videojs is a little finicky about the blob url being updated, but the video does actually play. I need to 🧹clean this up, but it looks like Local API in Cordova is totally possible. |
Since I've been having trouble with stuttering, I am going to refrain with pushing the proxy code for streaming into development, but I am pushing all of the other youtube.js changes into development at this time with the intent to push out a new release soon 🤞 because there is an issue currently preventing invidious being used as a proxy. (basically, the I will keep this issue open and update it as I implement the local API streaming interface so that one day, the local API will be able to be used fully without any need for proxying videos through invidious inside of the APK. |
Instruct webview to lie that it is `youtube.com` Pros: - local api streaming works without `file://` url flag Cons: - video urls fetched from invidious are still blocked by CORS - some urls don't allow youtube.com to fetch them and need to be bypassed by a javascript interface - it completely breaks browser navigation so that has to be reimplemented in freetube #5
Local API streaming is now available in the latest nightly. 🍾 🥂 |
##### ~~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
This is now resolved by release 0.20.0.115. |
Guidelines
Problem Description
Local API does not work because of CORS.
Proposed Solution
I could integrate a Cordova plugin into the application, so that the app can make http requests through OS level APIs exposed through the plugin. Then, those requests wouldn't have to worry about the CORS.
Alternatives Considered
This might also not be a problem. The invidious API works very well, and it might also just be good enough for stability to allow multiple invidious servers to be designated as fallbacks instead of Local API being a fallback.
Issue Labels
improvement to existing feature
Additional Information
No response
The text was updated successfully, but these errors were encountered: