brave-core icon indicating copy to clipboard operation
brave-core copied to clipboard

Download media from given web contents

Open sangwoo108 opened this issue 2 years ago • 27 comments

In real situation, we'll download medias from web contents in tab strip model. In order to demonstrate that, add API and test UI for brave://playlist.

Resolves https://github.com/brave/brave-browser/issues/24405

DEMO:

https://user-images.githubusercontent.com/5474642/182630842-86b93ba2-65ad-4f18-b8ed-1919ad0dac07.mov

Submitter Checklist:

  • [ ] I confirm that no security/privacy review is needed, or that I have requested one
  • [x] There is a ticket for my issue
  • [x] Used Github auto-closing keywords in the PR description above
  • [x] Wrote a good PR/commit description
  • [x] Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • [x] Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • [x] Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • [x] Ran git rebase master (if needed)

Reviewer Checklist:

  • [ ] A security review is not needed, or a link to one is included in the PR description
  • [ ] New files have MPL-2.0 license header
  • [ ] Adequate test coverage exists to prevent regressions
  • [ ] Major classes, functions and non-trivial code blocks are well-commented
  • [ ] Changes in component dependencies are properly reflected in gn
  • [ ] Code follows the style guide
  • [ ] Test plan is specified in PR before merging

After-merge Checklist:

  • [ ] The associated issue milestone is set to the smallest version that the changes has landed on
  • [ ] All relevant documentation has been updated, for instance:
    • [ ] https://github.com/brave/brave-browser/wiki/Deviations-from-Chromium-(features-we-disable-or-remove)
    • [ ] https://github.com/brave/brave-browser/wiki/Proxy-redirected-URLs
    • [ ] https://github.com/brave/brave-browser/wiki/Fingerprinting-Protections
    • [ ] https://github.com/brave/brave-browser/wiki/Brave%E2%80%99s-Use-of-Referral-Codes
    • [ ] https://github.com/brave/brave-browser/wiki/Custom-Headers
    • [ ] https://github.com/brave/brave-browser/wiki/Web-Compatibility-Exceptions-in-Brave
    • [ ] https://github.com/brave/brave-browser/wiki/QA-Guide
    • [ ] https://github.com/brave/brave-browser/wiki/P3A

Test Plan:

sangwoo108 avatar Aug 03 '22 12:08 sangwoo108

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 03 '22 13:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 03 '22 14:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 03 '22 15:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 04 '22 02:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 04 '22 04:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 04 '22 06:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 05 '22 06:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 05 '22 08:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 05 '22 10:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 05 '22 11:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 05 '22 14:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 06 '22 10:08 brave-builds

just tested in Nightly, and playlist does work for me there, so it's probably something about my local

Thanks @fallaciousreasoning ! When I cleared user data dir, it happens to me too! I think there's a problem in component. Let me check out again.


Ooops, it's not reproducible again :( @fallaciousreasoning Could you check what's inside .../Application Support/BraveSoftware/Brave-Browser-Development/jccpmjhflblpphnhgemhlllckflnipjn/1.0.2/index.js ? it should be same contents with https://github.com/brave/playlist-component/blob/main/index.js

sangwoo108 avatar Aug 08 '22 02:08 sangwoo108

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 08 '22 04:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 08 '22 07:08 brave-builds

Interesting, the folder ~/.config/BraveSoftware/Brave-Browser-Development/jccpmjhflblpphnhgemhlllckflnipjn exists but it's empty on my machine.

I tested with a new profile and the same thing happened (/tmp/bar/jccpmjhflblpphnhgemhlllckflnipjn exists but is empty).

fallaciousreasoning avatar Aug 08 '22 20:08 fallaciousreasoning

Interesting, the folder ~/.config/BraveSoftware/Brave-Browser-Development/jccpmjhflblpphnhgemhlllckflnipjn exists but it's empty on my machine.

I tested with a new profile and the same thing happened (/tmp/bar/jccpmjhflblpphnhgemhlllckflnipjn exists but is empty).

I should set up linux machine. @simonhong Have you ever heard of component problem on Linux?

sangwoo108 avatar Aug 08 '22 21:08 sangwoo108

Also though, it happens on master, so I don't think it should block this PR :smile:

fallaciousreasoning avatar Aug 08 '22 21:08 fallaciousreasoning

Interesting, the folder ~/.config/BraveSoftware/Brave-Browser-Development/jccpmjhflblpphnhgemhlllckflnipjn exists but it's empty on my machine. I tested with a new profile and the same thing happened (/tmp/bar/jccpmjhflblpphnhgemhlllckflnipjn exists but is empty).

I should set up linux machine. @simonhong Have you ever heard of component problem on Linux?

Let me check this PR on my linux.

simonhong avatar Aug 09 '22 00:08 simonhong

I confirmed that component is properly downloaded. Interesting thing is only click here to download works. ~~Download media from open tabs doesn't work on linux~~ . It had some delays. I can see both works well. Both works well on macOS.

simonhong avatar Aug 09 '22 00:08 simonhong

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 11 '22 03:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 11 '22 05:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 12 '22 04:08 brave-builds

@sangwoo108 please don't force push when a code-review is already in progress. I have no idea what has changed since last time :) IMO it's okay to force push when a PR is just created and you're fixing obvious build issues, but when there's a lot of discussion on critical parts, let's use new commits to add new things, otherwise it's very hard to keep track of what's going on.

goodov avatar Aug 15 '22 13:08 goodov

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 15 '22 14:08 brave-builds

@sangwoo108 please don't force push when a code-review is already in progress. I have no idea what has changed since last time :) IMO it's okay to force push when a PR is just created and you're fixing obvious build issues, but when there's a lot of discussion on critical parts, let's use new commits to add new things, otherwise it's very hard to keep track of what's going on.

Oops, sorry. I didn't notice that. I'll do that from now on.

sangwoo108 avatar Aug 15 '22 23:08 sangwoo108

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 16 '22 04:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 17 '22 08:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 17 '22 08:08 brave-builds

A Storybook has been deployed to preview UI for the latest push

brave-builds avatar Aug 17 '22 09:08 brave-builds