Commit graph

199 commits

Author SHA1 Message Date
mayeaux 0cc0e213a5
Anthony watchman integration (#6799)
* raw ingredients done adding functionality

* essentially working just need a cleanup

* almost working with a couple bugs

* almost working but a bug or two

* seems to be working well

* seems to be working well but needs a cleanup

* couple of bug fixes

* basically working now cleaning up

* seems to be working pretty well

* cleanup unnecessary changes

* eslint fixes

* bugfix seek event

* bugfix and andrey fix and better docs

* getting ready to add last piece of functionality

* handle seek events properly

* add dynamic duration to calculate interval properly

* fix lint errors

* last couple changes

* only run watchman with analytics on and on prod

* flow fixes

Co-authored-by: zeppi <jessopb@gmail.com>
2021-08-10 16:42:50 -04:00
zeppi 892a6deeaf reenable prerolls 2021-08-10 16:30:58 -04:00
zeppi 68bc4e3b90 Revert "disable google imasdk"
This reverts commit 283bbb52fa.
2021-08-10 16:30:58 -04:00
infinite-persistence 1d6101ddd2 Report recsys info when 'share_data_usage' is enabled.
Previous:
~~Although it was collecting info for all platforms, the data is only sent for Odysee.~~ Correction: it became enabled for all platform after `master` became Odysee.

New:
Only send out the telemetry for `IS_WEB` or if there's user consent.
2021-08-03 09:34:36 -04:00
infinite-persistence 34368760de Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry

The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.

## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.

## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
  - When clicked, we store the container ID in the navigation history `state` object.
    - For general cases, anyone can check this state from  `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-08-03 09:34:36 -04:00
infinite-persistence ffad52d5b7 Remove console.log
Seems like lint is being bypassed recently?
2021-07-23 08:42:58 -04:00
infinite-persistence 032e17cecd
Improve CLS on Posts
## Issue
6068 Fix "Cumulative Layout Shift" for Core Web Vitals

In Posts, the Comments section appears first while we fetch the MD file. When the MD is fetched, Comments get pushed to the bottom (or shifted up for short posts), hence the red CLS scores.

## Approach
There are too many layers between `<FilePage>` and `<DocumentViewer>` to pass the `loading` state around to hide the Comments section, so just make Comments fade in after a 2s delay.

## Changes
- Posts: Add 2s fade-in delay to Comments.
- Posts: remove the gray placeholder. This improves the score a bit more, and reduces flicker as well. There's already a spinner from `FileRenderInline` to tell the user to be patient.
- Posts: add a minimum 30vh height so that short posts don't get collapsed too much, causing the `FileDetails` and Comments to shift. Small shifts are fine as long as CLS is below 0.1.
2021-07-22 10:38:01 +08:00
zeppi 283bbb52fa disable google imasdk 2021-07-20 15:12:14 -04:00
zeppi 8674b97be8 disable aniview 2021-07-20 15:12:14 -04:00
zeppi f6dc48fdc0 use odysee recsys plugin 2021-07-19 17:30:44 -04:00
zeppi 50875566ad more 2021-07-19 13:52:15 -04:00
jessopb ae2354a0e0 Revert "move stuff to web (#6537)"
This reverts commit a6c413da5c.
2021-07-19 10:12:57 -04:00
jessopb a6c413da5c
move stuff to web (#6537) 2021-07-18 21:57:36 -04:00
zeppi 70af46149d discover channelIds from homepages 2021-07-16 18:31:48 -04:00
DispatchCommit d32af5606b move pre-roll ad logic into it's designated video.js plugin 2021-07-13 22:22:06 -04:00
DispatchCommit 47d9b4a866 fix site detection, add hide logo to macro url 2021-07-13 00:06:32 -04:00
DispatchCommit 8253f5e0dc center play button 2021-07-13 00:06:32 -04:00
DispatchCommit b777669a7e Add pre-roll ads
change ad macro url
rework video.js load logic
fix autoplay and retry errors
yeet player.ended error
fix another race condition
fix another error message
add allowPreRoll restrictions
fix some lint issues
remove annoying lint rule
remove video.js lazy loading
more linting fixes
2021-07-13 00:06:32 -04:00
infinite-persistence 5d8e3d8b0a
Revert lazy-loading videojs
## Issue
The loading circle wasn't showing up, causing confusion.

Splitting CSS doesn't seem trivial as there seems to be a huge dependency on the load order. Pretty much similar to what this person is facing https://lihautan.com/css-code-splitting/#the-problem

## Change
This reverts videojs-specific changes from 4d638bcf.
2021-07-06 17:04:16 +08:00
infinite-persistence 2e0f8c6120
Fix videojs overlay css
Related:
aaffd3b089 "CodeSplit: Load 3rd-party css before ours."
2021-07-01 15:23:42 +08:00
DispatchCommit da23a5625b fix video js imports 2021-06-30 19:12:21 -07:00
zeppi 304c0553da lint 2021-06-29 14:52:11 -04:00
John B Nelson 5e2a4960fb FIX video.js event firing issues fore RecsysPlugin
- The `rateChange` event now logs the updated speed,
   not just the    time at which it occurred.
- The `scrub` now (more) accurately logs the position
   it came from before the destination.
- The recsys events get consolidated for logical consistency.
2021-06-29 14:52:11 -04:00
DispatchCommit 8ce12f8e60 fix autoplay for transcoded files 2021-06-29 14:52:11 -04:00
infinite-persistence 5766dc34b5 Port recsys to master; enabled for SIMPLE_SITE only 2021-06-29 14:52:11 -04:00
Anthony 312c561529 update comment 2021-06-26 22:26:40 -04:00
Anthony ab13b23cef dont display cc button via videojs settings 2021-06-26 22:26:40 -04:00
infinite-persistence aaffd3b089
CodeSplit: Load 3rd-party css before ours.
A temporary solution until we code-split css.
2021-06-25 16:00:45 +08:00
infinite-persistence 3539031e5a
CodeSplit: Initial work 2021-06-25 16:00:44 +08:00
infinite-persistence 244f5ecaa4 Fix videos not switching when floating player is up
## Issue
6278 Video doesn't switch when floating player is up

## Notes
Not sure why the double `src` call is needed, but it is.
2021-06-19 11:23:29 -04:00
zeppi eff948f786 toms fix for player timeout bug 2021-06-11 13:40:01 -04:00
infinite-persistence 47539edcab Fix lint (removal of videoFetchDuration) 2021-06-10 10:14:52 -04:00
Andrey Beletsky 27abc1e9d3 Remove erroneous multiplication of time to start by 1000 2021-06-08 13:42:40 -04:00
Anthony 272eb90392 remove native controls for ios 2021-06-04 15:41:42 -04:00
Anthony eef218a807 use video js viewer for ios and add playsinline 2021-06-04 15:41:42 -04:00
infinite-persistence 2dac41e5e5
Mute video when autoplay is blocked by browser policy (#6087)
## Issue
When opening a video directly in Chrome Incognito, the video should autoplay (since that's the default Lbry setting), but it doesn't due to browser policy
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

## Changes
- We don't want to forcefully mute the video when `autoplay=true`; we just want to do it when the browser policy is applied.
- Fortunately, there is already an existing code-block for us to check that.

## Test cases
- [x] "Autoplay=Off" should not be affected.
- [x] After manually unmuting, the next autoplayed video should not be muted (this is "user interacted" opening, so the policy allows autoplay)
- [x] If manually muting, the next autoplayed video should retain user's last setting.

## Known issues
- I've seen `error` occasionally being undefined in the `catch` block. In those cases, the solution doesn't work. We could remove `if (player.autoplay() && !player.muted())` and simply just try muting it, but for now it's better to ensure `NotAllowedError` is due to unmuted first before applying the fix.
- This doesn't work for Firefox as there is an explicit "Allow Autoplay" button in the address bar that user needs to click themselves. Applies to all sites.
2021-05-19 11:56:54 -04:00
infinite-persistence b0996d4d18 Mobile: make double-tap match the arrow keys (+/-5s instead of 10s)
## Issue
One of the items in 5865 Video shortcut issues

This one is not really an issue, but it would be nice to match what the arrow keys are doing. Also, in slower regions, seeking 10s will almost always end up buffering.
2021-04-27 09:26:19 +08:00
Sean Yesmunt f2d83cbf9d fetch ads provider for all homepage videos (but still only show ads for unauth users) 2021-04-26 16:38:33 -04:00
Max Kotlan 1279a6eaaf Fixed and cleaned up Hotkeys. Fixed overlapping lbry hotkeys with browser hotkeys 2021-04-19 13:34:10 -04:00
Sean Yesmunt e08b71774c pre-roll ads 2021-04-12 12:55:06 -04:00
infinite-persistence fb839b92ef Only apply Staked Levels to Comments (allow it in Posts)
Blocking videos and images was too limiting, plus the system was intended to block spammy comments in the first place.
2021-04-09 11:27:07 -04:00
DispatchCommit 954966abbb fix linting errors 2021-03-21 20:36:50 -04:00
r0ckinn 6b8554517c also add keybinds for volume 2021-03-21 20:36:50 -04:00
r0ckinn 6b3dce0450 improve keyboard shortcuts 2021-03-21 20:36:50 -04:00
infinite-persistence c7d7bef1d7 vjs: Narrow down changes to just playback rate
## Changes
- Restore original code for how Volume and Mute is restored.
- Playback rate will be only change that gets "re-restored" in "loadedmetadata".
2021-03-15 15:03:15 -04:00
infiinte-persistence 83912627de vjs: Fix 'Video-setting persistence broken'
## Issue
5513: Video-setting persistence broken

## Notes
- Per videojs recommendation, the setting-restoration should be done after the video has been loaded, so the action was moved to `loadedmetadata`. This fixed the volume slider problem, and should have fixed the playbackRate too.
- For playbackRate, there is another special case where it gets reset to 1 (refer to comments in code).
2021-03-15 15:03:15 -04:00
infiinte-persistence 09c1cfeb8f vjs: Fix 'Video showing previous audio clip's thumbnail instead'
## Issue
5450: Video showing previous audio clip's thumbnail instead

## Notes
`createVideoPlayerDOM` depends on `isAudio`
2021-03-15 15:03:15 -04:00
infiinte-persistence 9ce6ecc923 Lint fixes
I just wanted to make the lint fixes in a separate commit to make the diff's for the next commit clearer.
2021-03-15 15:03:15 -04:00
infinite-persistence 0d850742f5 Disable video previews in Comments and Post if author is below a certain level. 2021-03-12 10:38:16 -05:00
Sean Yesmunt 7702477e71 better posts styling 2021-03-11 14:12:59 -05:00