Commit graph

48 commits

Author SHA1 Message Date
infinite-persistence
49db1fe83b Replace IS_IOS and IS_ANDROID with platform 2022-04-14 10:29:01 -04:00
infinite-persistence
745e40a83e
Move blocker flag to redux
Was trying to save 1 state by assuming the homepage will be in a busy state and the ad-detection code will finish first. But this is not true for those with a small Following count.
2022-03-16 16:48:26 +08:00
mayeaux
4a9ba6555b
Various touchups/fixes of membership functionality (#1066)
* various cleanups

* more touchups

* select currency to use based on location

* fix sidebar

* fixing strings and other touchups

* refactor and do proper string interpolation

* fix stripe error

* text bugfix

* Adjust help

Co-authored-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
2022-03-14 22:38:45 -04:00
infinite-persistence
de29e323a8
Homepage-Following: insert instead of replace when ad-blocker is detected (#1092)
* Homepage-Following: insert instead of replace when ad-blocker is detected.

`window.odysee_ad_blocker_detected` was not meant to be used outside of `<Ads>`, since it wouldn't spark a GUI update. But since homepages are rendered several times, perhaps it doesn't matter and we can skip adding to redux for now.

* Handle uBlock origin

If refreshed via "Clear Cache and Hard Reload", the detection method fails, but it does perform an internal redirect, so treat that as a failure.
2022-03-14 14:25:51 -04:00
infinite-persistence
ea7a6cb04f
Fix tile misaligned due to ad-blockers. 2022-03-10 22:03:19 +08:00
infinite-persistence
ea8af5aa89
Handle case where ad-cleanup fails (redo)
The solution didn't work 100%, only reduces the chances of happening significantly. So far, still can happen on hot-reload during development.

- Reverted 15bd26399f.
- Fix by just hiding the unoccupied aniBox
2022-03-10 21:54:12 +08:00
mayeaux
fb3a73d8a7
Membership subscriptions (#812)
Enter: Odysee Premium.
2022-03-09 13:05:37 -05:00
infinite-persistence
15bd26399f Handle case where ad-cleanup fails
## Issue
Double ads on screen

## Reproduce
- Pre re-design:
    - Change "Only Language" from tne locale nag.
- Post re-design:
    - Follow a bunch of channels with active livestreams. The homepage ad will show 2 ads stack on each other, with second one invisible.

Both should be equivalent, just different UI/style.

## Analysis
In both cases, it is due to `removeIfExists` failing to remove the element if the ad script hasn't run yet.

This can happen when the component is re-mounted immediately after the ad script was added. When the effect-cleanup runs, the script have not started or is running halfway.

Aside: The need to run `removeIfExists` further strengthens my hunch that the script is meant to live throughout the lifetime of the app, with it populating the given div as we navigate. But just my guess.

## Approach
Clean up before adding the script as well. This covers any missed elements from the previous cleanup.

The drawback is that this approach assumes there will only be 1 ad per page, but that's pretty much the case with the existing `removeIfExists` approach.
2022-03-09 08:47:13 -05:00
infinite-persistence
a98dc18fc6
Fix EU ad and minor tweaks
- Initially, we did a bunch of forceful CSS to make the ad tile resize properly when the browser resizes. This was causing the EU ad to display incorrectly. Turns out, that css is no longer needed after the BEM-style re-write.

- Changed the floating ad selector to cover both EU and non-EU version. It's probably still not the best given it relies on style rather than ID, but the ID seems dynamic.
2022-03-09 18:44:38 +08:00
infinite-persistence
73552e35f9
Ad: remove unused style ID
- Removed "customAniviewStyling"
    - No longer exists -- it was from the old DOM manipulation method.

- Removed "with no tileLayout it indicates sidebar ad"
    - Misleading and not useful. I can easily set the sidebar ad to Tile if we wanted to (it used to be in Tile, we changed to save space). So, every time we change the style, we need to update the comment??

    - The sidebar is not the only place that List layout is used -- there's Channel and Category pages, which allows either layout.
2022-03-09 16:02:11 +08:00
Anthony
af8d742b75 add some comments for documentation 2022-03-08 10:53:52 -05:00
infinite-persistence
0fa20114be Re-enable for Firefox Android
Since we are temporarily disabling the floating ad, it means that the invisible close button issue in Firefox Android is also temporarily not an issue.
2022-03-08 10:53:52 -05:00
infinite-persistence
cdcedb8063 Don't use EU script on mobile as it breaks the app 2022-03-08 10:53:52 -05:00
infinite-persistence
0143b63c74 Ads: replace DOM manipulations with React components
- Instead of 2 ways to display ads (DOM injection + React method) and having both of them clash, just do it the predictable React way.
    - Augment the existing React version to support tile layout + ability to place in last visible slot.
    - Consolidate styling code to scss ... DOM manipulations were making it even harder to maintain.
    - Removed the need to check for ad-blockers for now. It was being executed every time an ad is displayed, and now that we are displaying ads in more places, the gains doesn't justify the performance loss. Also, it wasn't being done for Recommended ads anyway, so the inconsistency probably means it's not needed in the first place.

Other known issues fixed:
- double ad injection when changing language via nag.
- additional "total-blocking-time" due to ads at startup removed.
- fixed ads not appearing in mobile homepage until navigated away and back to homepage.
- enable ads in channel page.
- support for both List and Tile layout.
2022-03-08 10:53:52 -05:00
infinite-persistence
e2f73a30c6 Remove triggerBlacklist
Since `triggerBlacklist` is just a simple boolean and `<Ads>` is not doing any additional logic on top of it, it doesn't make sense to pass as a parameter. Just not mount the component -- it's more concise and obvious at the client side.
2022-03-08 10:53:52 -05:00
infinite-persistence
1b0b9cad94 Cleanup ad container css
- Non hardcoded way to reserve space.
- Replace hardcoded margin.
2022-03-08 10:53:52 -05:00
infinite-persistence
f979f9b575 Code cleanup; no functional change 2022-03-08 10:53:52 -05:00
Thomas Zarebczan
784711c4e3
Mobile ads on Android too 2022-01-19 10:20:07 -05:00
Thomas Zarebczan
2eadd986b4
ad adjustments per vidcrunch
confirming what to do with the mobile tag...
2022-01-18 09:56:58 -05:00
mayeaux
ae976c377e
EU ads (#700)
* add new ad

* bugfix

* prioritize eu ad over mobile ad

* replace frontpage ad with EU ad

* bugfix checking for EU
2022-01-14 14:21:17 -05:00
mayeaux
58bdcbd1ed
Reduce triple call to single call, improve video loading, fix embed play button being off-center (#546)
Lots of optimizations and cleanup for the player. If we run into any strange issues, can revert.
2022-01-06 14:28:27 -05:00
Anthony
ec5a9802fc
Refactor ad implementation, fix two bugs (#616) 2022-01-05 16:15:08 +08:00
Anthony
cac05d5714 more touchups 2022-01-04 18:05:10 -05:00
Anthony
e3395e31ba refactor ad implementation 2022-01-04 18:05:10 -05:00
Anthony
28bcb96ec7 autoscroll on home page and dont run ads js at all for firefox android 2022-01-04 18:05:10 -05:00
Anthony
5f874e44a7 disable ads on android firefox 2021-12-13 12:31:41 -05:00
Anthony
b34de2d5cf dont run sidebar ad on android firefox 2021-12-13 12:31:41 -05:00
mayeaux
1bfe9e2eda
Ad blacklist terms (#434)
* coming along well

* working properly

* check claim name and dont have side effect if the environment vars are not set

* check against claim name
2021-12-06 13:01:40 -05:00
mayeaux
82643b1f4a
Finish cleaning out DOM (#413)
* finish cleaning out dom

* lint
2021-12-02 13:22:51 -05:00
mayeaux
a842a58608
Persist ads (#411)
* persist homepage ads

* persist all ads
2021-12-02 12:04:40 -05:00
mayeaux
6d3ec149b3
use second card on small screens and dont load script if authenticated (#406) 2021-12-01 09:52:03 -05:00
infinite-persistence
6fb2e02e3a
Change ad script injection method + fix effect dependency (#396)
## Issue
Tom seeing crashes on the line that was trying to remove the script, saying it's not a child of that node.

## Changes
- I'm guessing the found `fjs` sometimes is not in `head`, but we always remove from `head` during cleanup. Just append to the bottom of head, and remove from head. I think script order doesn't matter if we are injecting at runtime?

- Fixed effect dependency while at it (the latest PR removed the need to check for `type`).
2021-11-30 22:17:28 -05:00
infinite-persistence
0aff130ea4
Fix lint and formatting (#394) 2021-11-30 19:53:23 -05:00
mayeaux
1e071550ae
Add ad to the homepage as a card (#362)
* coming along well

* coming along well

* adding custom react element

* coming along well

* coming along well

* coming along well

* working pretty well

* almost done

* essentially working just could use a couple touchups

* cleanup and lint errors

* fix lint errors

* fix flow errors

* possible bugfix

* dynamically set width and height

* only run when rowdata is populated

* trying using ref

* better way to check for card population

* working implementation

* working implementation

* clean up flow and clean up script

* fix typo in comment and logs
2021-11-30 17:01:03 -05:00
mayeaux
f2715fa97b
Adds GDPR support (#311)
* add gdpr support

* only run on production

* testing implementation

* just needs last touches then ready

* ready for merge

* add cookies to sidebar

* hide button when secureprivacy not available

* switch over to loading script as a react hook

* conditionally add secureprivacy script

* save gdpr status on session

* better design
2021-11-23 10:21:33 -05:00
infinite-persistence
73f208923a
Optimize makeSelectClaimIsNsfw (and it's surrounding friends) 2021-11-16 10:14:01 +08:00
mayeaux
d047a748b7
Test ads (#277)
display ad in related sidebar for video view page

Co-authored-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
2021-11-11 17:15:50 -05:00
Merge
30023422b8
Desktop cherry-pick: "7240 Integrate lbry redux and lbryinc" 2021-10-19 20:40:07 +08:00
infinite-persistence
c62c667436
CLS: reserve space for injected video ads 2021-07-23 13:23:51 +08:00
zeppi
6d8fce6011 remove more google 2021-06-23 08:54:19 -04:00
zeppi
0da3fbf309 flow fix 2021-03-22 18:19:16 -04:00
zeppi
611b07052c get out of (adsense) jail free 2021-03-21 16:51:49 -04:00
zeppi
bce86ae8a3 remove adsense script when blocked 2021-02-10 10:19:50 -05:00
zeppi
ac6bf00b93 script error 2021-02-03 00:13:04 -05:00
zeppi
958fb0b085 fix ads blacklist 2021-02-03 00:13:04 -05:00
zeppi
e8de12bf91 fix flow in ads component 2021-02-02 21:18:13 -05:00
zeppi
11931d4037 provide ad blacklisting 2021-02-02 21:18:13 -05:00
zeppi
d04b0f09ba fix ad areas and drivers 2021-01-26 19:39:22 -05:00