Page MenuHomePhabricator

[e.cash] Stealth theme video speed
ClosedPublic

Authored by johnkuney on May 1 2023, 20:04.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC8841ff3a40d4: [e.cash] Stealth theme video speed
Summary

Adding some functionality to control background video playback speed based on theme specification.

I went for 0 for the stealth theme as I thought it looked better/more stealthy than a slowed down version, but open to other thoughts here

Test Plan

npm run dev
Switch themes with the bottom right switch, the background video should stop playing in stealth theme. It should resume when theme is switched back
Adjust the videospeed value in the theme to differnt numbers. See if it still works and if you find any values more appealing
@bot preview-e.cash
See if it builds and runs correctly

Diff Detail

Repository
rABC Bitcoin ABC
Branch
ecash-video-slowdown
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23587
Build 46788: Build Diff
Build 46787: arc lint + arc unit

Event Timeline

bytesofman requested changes to this revision.May 1 2023, 21:44
bytesofman added a subscriber: bytesofman.
bytesofman added inline comments.
web/e.cash/components/videobackground/index.js
6–15

^ above recommended change looks confusing. suggestion is to replace existing code with

const themeContext = useContext(ThemeContext);
    const videoRef = useRef();

    useEffect(() => {
        videoRef.current.playbackRate = themeContext.filters.videospeed;
    }, [themeContext.filters.videospeed]);

i.e. remove the setSpeed function

kinda ridiculous that this is how it needs to be done in React but I couldn't find any way to just set playbackRate directly on the <video> component in react.

web/e.cash/styles/theme.js
35

while 0 is probably the coolest param for toggling between the two themes, when this is launched that won't be how the user experiences the page.

0.4 seems to have the right gravitas

This revision now requires changes to proceed.May 1 2023, 21:44

remove unneeded function, change timing to 0.4

This revision is now accepted and ready to land.May 1 2023, 22:02
This revision was automatically updated to reflect the committed changes.