Improve fullscreen mode of the viewer #2515

Merged
btzr-io merged 6 commits from fullscreen into master 2019-06-10 20:43:45 +02:00
btzr-io commented 2019-05-26 08:25:50 +02:00 (Migrated from github.com)

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Fixes

  • Toggle video player on DoubleClick.
  • Toggle fullscreen when pressing f #2159
  • Can't exit full-screen from embedded content with key F11 #2514
  • Full screen (f11) does not work for games (PDFs and images also) #2267
  • Full screen Button Stops Working After Double Click #2392

Changes

  • New button to toggle full screen mode of viewer.
  • New shorcut to toggle fullscreen mode of viewer ( key:f ).
  • Fullscreen mode for all type of files.

Todo

  • Polyfill fullscreen api (only works in chrome ).

fullscreen

## PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [ ] I have checked that this PR does not introduce a breaking change - [ ] This PR introduces breaking changes and I have provided a detailed explanation below ## PR Type What kind of change does this PR introduce? - [x] Bugfix - [x] Feature - [ ] Code style update (formatting) - [x] Refactoring (no functional changes) - [ ] Documentation changes - [ ] Other - Please describe: ## Fixes - Toggle video player on DoubleClick. - Toggle fullscreen when pressing `f` #2159 - Can't exit full-screen from embedded content with key F11 #2514 - Full screen (f11) does not work for games (PDFs and images also) #2267 - Full screen Button Stops Working After Double Click #2392 ## Changes - New button to toggle full screen mode of viewer. - New shorcut to toggle fullscreen mode of viewer ( key:` f ` ). - Fullscreen mode for all type of files. ## Todo - [x] Polyfill fullscreen api (only works in chrome ). ![fullscreen](https://user-images.githubusercontent.com/14793624/58378434-02595c00-7f51-11e9-9669-40bd179e6730.gif)
tzarebczan commented 2019-05-29 02:00:55 +02:00 (Migrated from github.com)

Thanks for the PR @btzr-io ! We'll get it reviewed tomorrow hopefully.

Thanks for the PR @btzr-io ! We'll get it reviewed tomorrow hopefully.
neb-b (Migrated from github.com) requested changes 2019-05-29 07:42:45 +02:00
neb-b (Migrated from github.com) left a comment

This is great. Minor comments

This is great. Minor comments
neb-b (Migrated from github.com) commented 2019-05-29 07:38:14 +02:00

This should be lowercase for consistency

This should be lowercase for consistency
neb-b (Migrated from github.com) commented 2019-05-29 07:36:00 +02:00

This can just be updated to componentDidUpdate

nextProps becomes prevProps
and this.props references the new props

This can just be updated to `componentDidUpdate` `nextProps` becomes `prevProps` and `this.props` references the new props
neb-b (Migrated from github.com) requested changes 2019-06-03 16:58:49 +02:00
neb-b (Migrated from github.com) left a comment

We should be using refs instead of querying the dom

We should be using refs instead of querying the dom
neb-b (Migrated from github.com) commented 2019-06-03 16:57:13 +02:00

This should use a ref. We will need probably need to pass it to this component with forwardRef. Or we could use useRef, but that would involve turning the component that uses content_embedded to be a function component so it can use context/hooks.

This should use a ref. We will need probably need to pass it to this component with `forwardRef`. Or we could use `useRef`, but that would involve turning the component that uses `content_embedded` to be a function component so it can use context/hooks.
@ -125,9 +129,12 @@ class FileViewer extends React.PureComponent<Props> {
handleKeyDown(event: SyntheticKeyboardEvent<*>) {
const { searchBarFocused } = this.props;
neb-b (Migrated from github.com) commented 2019-06-03 16:57:47 +02:00

this.container.current

`this.container.current`
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#2515
No description provided.