-
Notifications
You must be signed in to change notification settings - Fork 43
[PAY-1590] Hook up content previews for USDC content #3968
Conversation
Preview this change https://demo.audius.co/pay-1590-hook-up-previews |
abe4198
to
1ae4686
Compare
Preview this change https://demo.audius.co/pay-1590-hook-up-previews |
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.
This is awesome, great work
queryParams.preview = true | ||
trackDuration = Math.min( | ||
track.duration - previewStartSeconds, | ||
PREVIEW_LENGTH_SECONDS |
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.
nice, good looks
trackId: playActionTrack.track_id, | ||
onEnd: next | ||
// Don't auto-advance after previews | ||
onEnd: isPreview ? playerActions.stop : next |
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.
Are you sure that's what we want? In lineups, that would make streaming stop, no?
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.
I can follow up with design and double check. Generally I think we need to clarify the subtleties of how previewable tracks interact with lineups and queu.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
[533affd] Commit package-lock sliptype [30596c5] Disable setup sliptype [a4af082] Disable branch filter sliptype [62c3391] Fix versions sliptype [60943ec] [C-3032] Fix collectible gated upload (#4012) Dylan Jeffers [bcf3473] [C-3035] Stale stats for offline tracks (#4010) Dylan Jeffers [6af2a34] Prepare 1.5.40 full app release (#4011) Dylan Jeffers [c19274a] [PAY-1791] Withdraw USDC - transfer to dest account (#4002) Reed [c36e63a] [C-3004] Scroll to top when switching tracks in upload (#4006) Andrew Mendelsohn [8c2966b] [C-3014] Add prompt on leaving upload form in progress (#3989) Andrew Mendelsohn [df42ea2] CI fixes for mobile (#4008) Sebastian Klingler [0d32111] [PAY-1723] Purchase content twitter share copy (#4005) Reed [a6585df] [PAY-1764] Update USDCCard icons in artist dashboard (#4003) Reed [92d839b] [C-3031] Fix transaction history numbers (#4001) Dylan Jeffers [2e6aef3] Remove unused TrackAvailabilityModal (#3994) Andrew Mendelsohn [6572576] [PAY-1734] Implement skeleton withdraw USDC modal (#3999) Raymond Jacobson [a1a2feb] [C-3017] Reset the new upload flow state when the upload button in the side nav is clicked (#4000) Kyle Shanks [294e7b3] [C-2954] Fix hashtag search (#3998) Dylan Jeffers [7587308] Add category to library query endpoint + more useAllPaginated fixes (#3975) nicoback2 [028e570] Fix CI (partially) (#3997) Sebastian Klingler [9b6c3e4] [C-2915] Implement Mobile USDC field (#3992) Dylan Jeffers [4e3c260] Fix AI learn more link (#3996) Reed [fe6cdbc] Fix misc embed deploy issues (#3995) Raymond Jacobson [42ca343] [C-3028] make the usdc inputs white (#3991) Andrew Mendelsohn [9f79838] [PAY-1776] Fix playing check for track page (#3993) Randy Schott [e0cd67d] [PAY-1591][PAY-1775] Implements content previews on native mobile (#3986) Randy Schott [a95a733] [C-2995] Add hint to modal radio items (#3990) Kyle Shanks [6b139db] [C-3029] Fix embed environment url (#3987) Dylan Jeffers [ec3a09d] [C-3022] Fix broken multi-track index after deleting (#3988) Andrew Mendelsohn [1ef154d] [PAY-1736] Implement new ArtistCard on dashboard (#3984) Raymond Jacobson [0df700b] Update files to account for changes on node 18 (#3985) Raymond Jacobson [d633a29] [PAY-1786] Withdraw USDC - create dest token account (#3982) Reed [fa060e2] [PAY-1755] Withdraw USDC flow: send signature to relay (#3980) Reed [b0d1d48] Add HarmonySelectablePill for mobile + Library filter pill menu (#3974) nicoback2 [cc723a1] Revert premium_conditions empty object change (#3983) Andrew Mendelsohn [7493cff] Fix validation on access and sale modal (#3981) Andrew Mendelsohn [a2b0890] Fix maxLength warning in search bar (#3979) Dylan Jeffers [9ba4c7b] [PAY-1761] Display USDC balance on artist dashboard (#3971) Reed [d47cd69] Fix TextField input spacing (#3978) Dylan Jeffers [83b7ae5] [PAY-1590] Hook up content previews for USDC content (#3968) Randy Schott [0ce85a2] [C-2921] Update subgenre value passed in the genre field (#3977) Kyle Shanks [c48179f] Fix text color for DMs (#3976) Marcus Pasell [559e50e] Improve sentry-cli usage in CI (#3972) Sebastian Klingler [0a4cca7] [PAY-1768] Convert artist dashboard to functional component (#3970) Reed [a171858] Fix embed ci with workspaces (#3969) Sebastian Klingler [bc73bef] Fix jupiter Buffer is not defined (#3967) Sebastian Klingler [3945552] [C-3026] Close now-playing when sharing to dm (#3966) Dylan Jeffers [8be4f39] [C-2999] Verify calendar input styles and update text when finalizing upload (#3965) Kyle Shanks [77aa099] [C-3020] Fix errors in usdc purchase field (#3964) Andrew Mendelsohn [c133a9c] [INF-445] Upgrade client to node 18, npm 9, and npm workspaces (#3927) Sebastian Klingler [650a6e2] [PAY-1506] USDC artist dashboard tile (#3963) Reed [68bba0d] [PAY-1715] Adds Sales page (#3957) Randy Schott [7d2f718] [PAY-1712] Implement purchases page (#3951) Randy Schott [314087b] [C-3025] Fix race-condition with stem/remix fetch (#3961) Dylan Jeffers [de2e27c] [C-3023] Fix collectible visibility (#3960) Dylan Jeffers [a0a5a84] [C-3012] Fix remixes deep link (#3958) Dylan Jeffers [9c2154c] [C-3018][C-2965] fix upload album/playlist description field styling (#3959) Andrew Mendelsohn [7cd1b00] [C-2791] Use artwork from the file if there is one (#3956) Andrew Mendelsohn [16c07ef] [C-3015] Add back button to new upload flow edit page (#3955) Kyle Shanks [353ca55] [C-2997] Disable delete on the last collection upload track (#3954) Kyle Shanks [f8dcd92] [C-3001, C-3003] Fix new upload flow error formatting (#3953) Kyle Shanks [4727ef4] [C-3000] Update audio file type icons (#3952) Kyle Shanks [1a2ce2a] [C-3002] Fix casing of selected values in upload flow (#3950) Kyle Shanks [dc3ed39] [C-3006][C-3005] Fix tag field wrapping (#3947) Andrew Mendelsohn [d047fda] Fix Share to IG/T/S sticker consistency [C-3009] (#3949) nicoback2
Description
This PR hooks up track previews for web and mobile web.
I added logic to the player saga to detect attempts to play tracks to which the user does not have access, switching to a preview instead if its available. This can be overridden by passing a boolean flag to the action. The previewing state is stored in the slice for retrieval later, which is helpful for determining the source of playback (full access of preview). I opted not to use a new UID for this as it felt like it would have gotten quite complicated attempting to combine multiple sources (previewing from a lineup vs playing the same track from a lineup?).
The TrackPageProvider is the only place that uses the boolean override, since we need to allow the track owner to preview the track.
The track page also makes use of the previewing state flag to determine which button shows "pause" when we're playing a preview. And we also make use of the previewing flag in the queue saga to force a reset if you switch from preview to full access.
How Has This Been Tested?
Tested locally in Chrome (desktop and mobile web emulation)
Screenshots
Playing Preview for non-owner
Kapture.2023-08-30.at.10.04.25.mp4
Playing Preview for non-owner from lineups
Kapture.2023-08-30.at.10.06.04.mp4
Playing preview for owner
Kapture.2023-08-30.at.10.08.18.mp4