kill render-media (range-requests) and add floating player #2707

Merged
neb-b merged 6 commits from not-streaming-but-streaming into master 2019-08-13 19:48:53 +02:00
neb-b commented 2019-08-02 08:25:25 +02:00 (Migrated from github.com)

By no means is this file viewer/purhcase logic code good, but this is sure as hell better than it was before.

The plan

Merge this shit before anyone can take a really close look at this I'm happy with this now. It should be a lot easier to work moving forward.

Things to actually do before this is ready

  • Fix purchase confirmation modal
  • Fix .lbry file support
  • Fix volume/mute memory
  • Add super basic image viewer
  • Add back analytics (possibly do this in another PR)
    • I stripped out all the analytics stuff for file views since it was so tangled up (and only worked for videos)
By no means is this file viewer/purhcase logic code _good_, but this is sure as hell better than it was before. ### The plan ~Merge this shit before anyone can take a really close look at this~ I'm happy with this now. It should be a lot easier to work moving forward. #### Things to actually do before this is ready - [x] Fix purchase confirmation modal - [x] Fix `.lbry` file support - [ ] Fix volume/mute memory - [x] Add super basic image viewer - [ ] Add back analytics (possibly do this in another PR) - I stripped out all the analytics stuff for file views since it was so tangled up (and only worked for videos)
neb-b commented 2019-08-06 05:30:03 +02:00 (Migrated from github.com)

This is ready. I'm going to wait to add analytics in a different PR. Just so we can get a little testing on this to see if anything crazy needs to change before I update this new play api. It should be fairly easy to add for all file types now.

This is ready. I'm going to wait to add analytics in a different PR. Just so we can get a _little_ testing on this to see if anything crazy needs to change before I update this new `play` api. It should be fairly easy to add for all file types now.
neb-b (Migrated from github.com) reviewed 2019-08-06 05:40:04 +02:00
neb-b (Migrated from github.com) commented 2019-08-06 05:40:04 +02:00

@tzarebczan Can you add some help text for this setting?

@tzarebczan Can you add some help text for this setting?
kauffj (Migrated from github.com) reviewed 2019-08-07 00:27:29 +02:00
kauffj (Migrated from github.com) left a comment

Slightly hastier review than I would have liked, but wanted to get something back to you today. I also did not run the code. I'd still like to do this, but do not let me block.

Slightly hastier review than I would have liked, but wanted to get something back to you today. I also did not run the code. I'd still like to do this, but do not let me block.
kauffj (Migrated from github.com) commented 2019-08-07 00:09:42 +02:00

Is blobs_completed a number or a boolean? this contrasts with https://github.com/lbryio/lbry-desktop/pull/2707/files#diff-90966bed4cd947a3f12fa8f891fd193aR35 below

Is `blobs_completed` a number or a boolean? this contrasts with https://github.com/lbryio/lbry-desktop/pull/2707/files#diff-90966bed4cd947a3f12fa8f891fd193aR35 below
@ -148,3 +101,4 @@
const source = IS_WEB ? `https://api.lbry.tv/content/claims/${claim.name}/${claim.claim_id}/stream` : streamingUrl;
// Human-readable files (scripts and plain-text files)
const readableFiles = ['text', 'document', 'script'];
kauffj (Migrated from github.com) commented 2019-08-07 00:13:05 +02:00

does the creation of mediaTypes trigger the instantiation/invocation of the individual components? or is that deferred until the element is used in some way? (I think it's the latter, but making sure)

does the creation of `mediaTypes` trigger the instantiation/invocation of the individual components? or is that deferred until the element is used in some way? (I think it's the latter, but making sure)
kauffj (Migrated from github.com) commented 2019-08-07 00:14:15 +02:00

out of scope for this PR, but I wonder if putting all of these on the Lbry object is the right design

out of scope for this PR, but I wonder if putting all of these on the `Lbry` object is the right design
@ -0,0 +11,4 @@
const SANDBOX_TYPES = ['application/x-lbry', 'application/x-ext-lbry'];
// This server exists in src/platforms/electron/startSandBox.js
const SANDBOX_SET_BASE_URL = 'http://localhost:5278/set/';
kauffj (Migrated from github.com) commented 2019-08-07 00:15:27 +02:00

are these important enough configuration values that they should be hoisted to top-level config of some kind? does anything else use them?

are these important enough configuration values that they should be hoisted to top-level config of some kind? does anything else use them?
@ -0,0 +52,4 @@
src={appUrl}
autosize="on"
style={{ border: 0, width: '100%', height: '100%' }}
useragent="Mozilla/5.0 AppleWebKit/537 Chrome/60 Safari/537"
kauffj (Migrated from github.com) commented 2019-08-07 00:15:53 +02:00

can this be read from Electron?

can this be read from Electron?
kauffj (Migrated from github.com) commented 2019-08-07 00:17:34 +02:00

Add 0.25, 0.75, and 1.1 (assuming no or minimal UI cost or other costs)

YouTube does 0.25 and 0.75 and I've found 1.1 is not very perceptible but still saves meaningful time

Add 0.25, 0.75, and 1.1 (assuming no or minimal UI cost or other costs) YouTube does 0.25 and 0.75 and I've found 1.1 is not very perceptible but still saves meaningful time
kauffj (Migrated from github.com) commented 2019-08-07 00:19:42 +02:00

can 53-59 just be:

videoNode.paused ? videoNode.play() : videoNode.pause()

can 53-59 just be: `videoNode.paused ? videoNode.play() : videoNode.pause()`
kauffj (Migrated from github.com) commented 2019-08-07 00:21:32 +02:00

Check boxes always enable, so you do not need to put this in the label. Present tense is better:

"Save all viewed content"

Helper text:

"Content is saved to downloads directory. Paid content and some file types are saved by default. Changing this setting will not affect previously downloaded content."

Possibly the first sentence of helper would be better in label, or something close to this. Try both.

Check boxes always enable, so you do not need to put this in the label. Present tense is better: "Save all viewed content" Helper text: "Content is saved to downloads directory. Paid content and some file types are saved by default. Changing this setting will not affect previously downloaded content." Possibly the first sentence of helper would be better in label, or something close to this. Try both.
kauffj (Migrated from github.com) commented 2019-08-07 00:23:00 +02:00

Rewrite similar to above, "Save..."

Rewrite similar to above, "Save..."
kauffj (Migrated from github.com) commented 2019-08-07 00:24:13 +02:00

i18n

i18n
kauffj (Migrated from github.com) commented 2019-08-07 00:25:05 +02:00

I've seen a few fileInfo checks similar to this, consider if it makes sense to combine into a selector (it might not).

I've seen a few fileInfo checks similar to this, consider if it makes sense to combine into a selector (it might not).
kauffj (Migrated from github.com) commented 2019-08-07 00:25:29 +02:00

why always save if cost > 0? I would not expect this

why always save if cost > 0? I would not expect this
kauffj (Migrated from github.com) commented 2019-08-07 00:25:53 +02:00

return is avoidable if made into 3 nested if

return is avoidable if made into 3 nested if
@ -102,3 +102,3 @@
export const selecetMute = createSelector(
export const selectMute = createSelector(
selectState,
kauffj (Migrated from github.com) commented 2019-08-07 00:26:16 +02:00

👌

:ok_hand:
neb-b (Migrated from github.com) reviewed 2019-08-07 21:43:37 +02:00
neb-b (Migrated from github.com) commented 2019-08-07 21:43:37 +02:00

It is a number, good catch

It is a number, good catch
neb-b (Migrated from github.com) reviewed 2019-08-07 21:44:33 +02:00
@ -0,0 +11,4 @@
const SANDBOX_TYPES = ['application/x-lbry', 'application/x-ext-lbry'];
// This server exists in src/platforms/electron/startSandBox.js
const SANDBOX_SET_BASE_URL = 'http://localhost:5278/set/';
neb-b (Migrated from github.com) commented 2019-08-07 21:44:33 +02:00

Nope, they exist entirely for this app viewer

Nope, they exist entirely for this app viewer
neb-b (Migrated from github.com) reviewed 2019-08-07 21:52:14 +02:00
neb-b (Migrated from github.com) commented 2019-08-07 21:52:14 +02:00

Nice. Much cleaner

Nice. Much cleaner
neb-b (Migrated from github.com) reviewed 2019-08-07 22:12:15 +02:00
neb-b (Migrated from github.com) commented 2019-08-07 22:12:15 +02:00

IMO nested if statements are harder to skim and understand. Especially when one of the if statements does something else.

Especially during this new video player refactor, the hardest parts to follow were blocks with nested if statements.

IMO nested if statements are harder to skim and understand. Especially when one of the if statements does something else. Especially during this new video player refactor, the hardest parts to follow were blocks with nested if statements.
kauffj (Migrated from github.com) reviewed 2019-08-07 22:43:04 +02:00
kauffj (Migrated from github.com) commented 2019-08-07 22:43:04 +02:00

So one if/else is okay, but a third means use an early return?

I don't hate this but I do think this will result in idiosyncratic code because I doubt others are following this paradigm

However, debating this is classic bikeshedding, so ship whatever you want

So one if/else is okay, but a third means use an early return? I don't hate this but I do think this will result in idiosyncratic code because I doubt others are following this paradigm However, debating this is classic bikeshedding, so ship whatever you want
tzarebczan (Migrated from github.com) reviewed 2019-08-08 13:06:20 +02:00
tzarebczan (Migrated from github.com) commented 2019-08-08 13:06:20 +02:00

Blobs completed is a count

Saw it was resolved but not fixed yet

Blobs completed is a count Saw it was resolved but not fixed yet
tzarebczan (Migrated from github.com) reviewed 2019-08-08 13:12:24 +02:00
tzarebczan (Migrated from github.com) commented 2019-08-08 13:12:24 +02:00

We also have the file name with extension in the claim data now, but we should fall back to file list when it's not available

We also have the file name with extension in the claim data now, but we should fall back to file list when it's not available
tzarebczan (Migrated from github.com) reviewed 2019-08-08 13:15:18 +02:00
tzarebczan (Migrated from github.com) commented 2019-08-08 13:15:17 +02:00

Will add it today.

Will add it today.
tzarebczan (Migrated from github.com) reviewed 2019-08-08 13:24:57 +02:00
@ -148,3 +101,4 @@
const source = IS_WEB ? `https://api.lbry.tv/content/claims/${claim.name}/${claim.claim_id}/stream` : streamingUrl;
// Human-readable files (scripts and plain-text files)
const readableFiles = ['text', 'document', 'script'];
tzarebczan (Migrated from github.com) commented 2019-08-08 13:24:57 +02:00

If download path exists and the file is completed, we should use that for the video and audio player.

If download path exists and the file is completed, we should use that for the video and audio player.
neb-b (Migrated from github.com) reviewed 2019-08-08 17:40:57 +02:00
@ -0,0 +52,4 @@
src={appUrl}
autosize="on"
style={{ border: 0, width: '100%', height: '100%' }}
useragent="Mozilla/5.0 AppleWebKit/537 Chrome/60 Safari/537"
neb-b (Migrated from github.com) commented 2019-08-08 17:40:57 +02:00

Possibly. I haven't spent any time looking into that, just copy pasting it from the old file

Possibly. I haven't spent any time looking into that, just copy pasting it from the old file
neb-b (Migrated from github.com) reviewed 2019-08-13 07:20:58 +02:00
neb-b (Migrated from github.com) commented 2019-08-13 07:20:57 +02:00

Since that only has some of the media types, I don't think it's worth it to use for now, especially since it's working pretty well.

And yeah, this is probably better as a regular utility function?

Since that only has _some_ of the media types, I don't think it's worth it to use for now, especially since it's working pretty well. And yeah, this is probably better as a regular utility function?
neb-b commented 2019-08-13 07:36:42 +02:00 (Migrated from github.com)

@kauffj this is ready for another review
I gave up on mute/volume/position memory, will circle back after this is merged but I'd rather get this in so I can start on the other tickets before the release.

I would just look at the last commit
2b09d56b63

I responded to your change requests and did all the floating player stuff in that one commit.

@kauffj this is ready for another review I gave up on mute/volume/position memory, will circle back after this is merged but I'd rather get this in so I can start on the other tickets before the release. I would just look at the last commit https://github.com/lbryio/lbry-desktop/pull/2707/commits/2b09d56b63c9d0b0187c0837475dfe9f781c1971 I responded to your change requests and did all the floating player stuff in that one commit.
kauffj (Migrated from github.com) reviewed 2019-08-13 17:27:08 +02:00
kauffj (Migrated from github.com) commented 2019-08-13 17:27:08 +02:00

@seanyesmunt I heard the answer to this but I still question it. I say remove.

@seanyesmunt I heard the answer to this but I still question it. I say remove.
kauffj (Migrated from github.com) approved these changes 2019-08-13 18:11:10 +02:00
kauffj (Migrated from github.com) left a comment

Code can be shipped, but some UX feedback left in Slack

Code can be shipped, but some UX feedback left in Slack
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#2707
No description provided.