Repository navigation
feat(play): one press saves a package too big for the chat, in a tab that fetches the video itself (#102) - #103
Merged
Merged
Conversation
… and Download of a video the chat cannot save opens such a tab with one press (#102)
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…dress, by the package's weight and not the video's (#102)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #102. Part of missing-elements/h5p-toolkit#210.
After #100 a package with a big video is saved in a chat by a right-click on Download. The owner: "right-click can be replaced by button click, I need one click to download." ChatGPT's own save refused a 128 MB test file, and a package built in the card cannot be passed to a tab. But the chat's file storage answers any site, so a tab of this page can fetch the video itself and build the package again.
What a person sees now
How
&links=(the files' addresses by name, JSON in base64url) and&save=1beside#source=. The page plays from the addresses; withsaveit acts as if Download was pressed once the activity is ready. Both are taken out of the address bar as soon as they are read, so an address of a person's file is not left in the history.savesandopens, where every file of the activity plays from an address and the package will weigh more thanmax(the preview's own package plus the sizes given for the files): Download sends{ type: 'open', href }with such a link at once, while the press still lets a tab open, and fetches nothing in the frame.sizesbesidelinksis read again (play: inside a chat, a package too big for the chat's save cannot be downloaded without leaving it, and links open nothing on a press #100 took it out).To weigh
save=1makes the page save a file with no press. It is the package the same link would build for a press on Download, and a browser lets a page save one file unasked before it asks the person. Addresses are taken as before: http(s) only, for a video or a recording, fetched without credentials.Checked
By hand, as this repository has no page tests: the built site served locally, framed by a page of another origin acting as a card (sandboxed like a chat's: saves nothing, opens no tab), with a store on a third origin that answers any site.
max, size given,savesandopens(light at 720 px, dark at 360 px)openwith/h5p/play/#source=…&links=…&save=1, the row above, noneeds-bytes; the link opened in a tab: the package saved with no press, the saved row, the address bar left with#source=onlymax, noopensmax(4 MB), the package (6.3 MB) over itmaxopen: fetched and built in the frame with both, the right-click rowmax,opens, no size givenmaxmax, nosaves; the link cases of #100npm run buildpasses. Screenshots of the rows and of the tab looked at.Not verified
Summary by cubic
One press on Download now saves a package too big for the chat's own save: a new tab opens, fetches the video itself from the chat's storage, rebuilds the package, and saves it without further interaction. The tab is opened only when every file in the package plays from a network address and the package's total weight exceeds the parent's limit, not just the video's size.
&links=(file addresses by name, JSON in base64url) and&save=1; withsave=1the page saves the package with no press once the activity is ready.openmessage with such a link and fetches nothing in the frame.Written for commit ac32868. Summary will update on new commits.