-
Notifications
You must be signed in to change notification settings - Fork 43
[PAY-1591][PAY-1775] Implements content previews on native mobile #3986
Conversation
Preview this change https://demo.audius.co/pay-1591-mobile-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.
lgtm!
] | ||
) | ||
|
||
const handlePressPlay = useCallback(() => play({ isPreview: false }), [play]) |
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.
if you set up the default args above in line 294, do you need to explicitly pass isPreview: false
here?
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.
Oh nope. Clearly I went through a couple iterations on this 😅
Preview this change https://demo.audius.co/pay-1591-mobile-previews |
[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
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Description
This PR adds plumbing to the mobile component layer to pass the preview flag in the same way as web.
In addition, I updated the data model of our Queue slice to support holding the preview flag in the
Queueable
model.Playback on mobile does not actually respond to any of the common player actions. The implementation for
audioPlayer
is stubbed out. So the logic we have in player sagas for reading the incoming action'sisPreview
flag and calculating the correct URL/duration have no effect.Instead, mobile uses its own logic in a component
Audio.tsx
, where it watches for changes to the queue redux slice and does similar logic to what occurs in the player sagas. Additionally, the Now Playing components on mobile do not derive duration from the player the way that web does. Instead, they read duration from the track. So the logic needed to be updated to determine if we're currently playing the preview version of the track (which is read from the player state). In the preview case, we now use a shared common function to determine the duration of the preview stream.There is also logic in the
Audio
component to watch for auto-advance from the native player and sync changes back to the player state. So I needed to make sure that all the player actions set the proper values forpreviewing
to correctly drop out of the previewing state when we finish a preview track.It's not the cleanest implementation. But I think a major refactor would be in order to get it much better.
How Has This Been Tested?
Locally tested on iOS simulator.
Screenshots