Skip to content
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

Support taking video screenshots outside of Electron #6399

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

absidue
Copy link
Member

@absidue absidue commented Dec 16, 2024

Support taking video screenshots outside of Electron

Pull Request Type

  • Feature Implementation

Description

At the moment taking video screenshots is a feature exclusive to the Electron build of FreeTube, which means that it is not usuable in the FreeTubeAndroid fork. This limitation is not so much an intentional limitation but more so because the existing implementation relied heavily on Node.js and Electron APIs.

This pull request add support for taking screenshots with prompting for the save location outside of Electron. I don't have access to a FreeTubeAndroid compatible device to test this but hopefully it should work, as it uses the same prompt and save function as the data export. Saving to a specific folder is not supported outside of Electron as writing files without prompting the user requires more power than the web APIs offer and would require changes to FreeTubeAndroid's Kotlin code to replicate what we do with the Electron and Node.js APIs.

Notable changes:

  • I removed the broken create subfolders functionality, this shouldn't affect anyone as the existing code would error when someone tried to set it up to save to a subdirectory.
  • The Saved screenshot toast no longer shows the file path where the image was saved.
  • Most screenshot settings are now shown and usuable outside of Electron, settings related to saving to the default folder are still hidden and ignored outside of Electron.

Testing

Test that taking screenshots with the prompt for save path setting enabled works in both Electron and in Firefox (or FreeTubeAndroid if you have a compatible devices).
Also test that I didn't break saving to the default folder in Electron.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: cfc2d62

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) December 16, 2024 21:24
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Dec 16, 2024
@absidue absidue removed the request for review from kommunarr December 16, 2024 22:35
@efb4f5ff-1298-471a-8973-3d47447115dc
  • Electron, LGTM
  • Browser, cant test due to error
VirtualBoxVM_P2ZaLZe4CD.mp4
  • Phone, is it possible to provide an .apk file so i can try out

@PikachuEXE
Copy link
Collaborator

PikachuEXE commented Dec 17, 2024

  • yarn dev
  • Test affected functionalities
  • yarn dev:web
  • Open the dev server URL in a web browser that doesn't support the Web File System API e.g. Firefox or Safari or if you have access to a FreeTubeAndroid compatible device you can test this pull request with that too.
  • Test affected functionalities

Get similar errors w/ multiple IV instances...
This is happening on dev too (Chrome + Firefox
image

@absidue
Copy link
Member Author

absidue commented Dec 17, 2024

Ah great, looks like just after I submitted this PR, all Invidious instances switched to blocking cross-origin requests: (CORS column on this page: https://api.invidious.io/).

@efb4f5ff-1298-471a-8973-3d47447115dc

instance doesnt seem to work for me as im getting the same error

@ChunkyProgrammer
Copy link
Member

ChunkyProgrammer commented Dec 19, 2024

If an Invidious instance is working, it's probably using iv-org/invidious#4985 which doesn't support proxying urls through the API so it will be almost impossible to test the web build at this time. I'll approve this since the electron build is working.

Related:
iv-org/invidious-companion#1
iv-org/invidious-companion#22

@FreeTubeBot FreeTubeBot merged commit 9fa18f3 into FreeTubeApp:development Dec 23, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Dec 23, 2024
@absidue absidue deleted the screenshots branch December 23, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants