-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial membership gift support #90
Conversation
const timestampUsec = parseInt(renderer.timestampUsec); | ||
const timestampText = renderer.timestampText?.simpleText; | ||
const runs = parseMessageRuns(messageRenderer.message?.runs); | ||
const timestampUsec = parseInt(renderer.timestampUsec || (Date.now() * 1000).toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChrRubin does this work? it's a bit cheap but basically if there's no timestampUsec i just made it generate one based on the time of parsing lmao
this should work if the issue you mentioned only happens for initial data load in live chats only, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to wait till a stream gets gifted before I can test this.
I don't know if it affects VODs, since that's even more of an edge case where someone has to gift memberships within ~10 seconds of the stream starting. We also are using videoOffsetTimeMsec
instead of timestampUsec
for VOD message showtimes, so maybe it isn't affected? Who knows with how YT does things...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup can confirm it's fixed for live streams
if that works, we should probably merge this before i spend my last 2 brain cells dissecting the enable gifting panel lolmao |
use https://youtu.be/k_skfzMMyso?t=5452 if u need a video to test with |
*clicks on vid |
typical gura experience lmao i love watching vods while deving i can feel both big brain and degen at the same time |
Adds partial support for membership gifts. Both "purchases" and "redemptions" are shown in the message area, and gift purchases are shown in the ticker bar. I'm not sure whether redeeming said gifts work for the user themselves, hence "partial" support until someone is lucky enough (or unlucky if it doesn't work via HyperChat) to find out.
I've also refactored the ticker chip UI to its own component since there was duplicate code.
MembershipItem.svelte
andPaidMessage.svelte
are basically reverted back to pre #79 aside from adding gift support toMembershipItem.svelte
.@KentoNishi I need help with a bug on the ticker logic. Membership gift tickers from initial data for live streams don't come with a
timestampUsec
value (thanks YT), so they will appear for a second and then disappear on the next tick, even though there's still duration left for the ticker. I'm assuming this line doesn't like the NaN showtime value, but I can't figure out how to fix it:HyperChat/src/components/StickyBar.svelte
Lines 19 to 28 in 73a8379