Live video on the AT Protocol

bugfix: add offline setting and fix timestamp parsing

+7 -3
+7 -3
js/app/components/livestream/livestream.tsx
··· 72 72 const streamerProfile = streamerDID ? profiles[streamerDID] : undefined; 73 73 const streamerHandle = streamerProfile?.handle; 74 74 const startTime = player.livestream?.record?.createdAt 75 - ? new Date(player.livestream?.record?.createdAt) : undefined; 75 + ? new Date(player.livestream?.record?.createdAt) 76 + : undefined; 76 77 77 78 // this would all be really easy if i had library that would give me the 78 79 // safe area view height and width but i don't. so let's measure ··· 112 113 const cuttOffDate = new Date(Date.now() - 10 * 1000); 113 114 // 15 second cut off if segment start time not found 114 115 const startTime = player.segment?.startTime 115 - ? new Date(player.segment?.startTime) : new Date(Date.now() - 15 * 1000); 116 + ? new Date(player.segment?.startTime) 117 + : new Date(Date.now() - 15 * 1000); 116 118 117 119 if (startTime > cuttOffDate) { 118 120 setOffline(false); ··· 278 280 )} 279 281 </View> 280 282 <View flexDirection="row" alignItems="center" gap="$2"> 281 - {(startTime instanceof Date) && !offline && <Timer start={startTime} />} 283 + {startTime instanceof Date && !offline && ( 284 + <Timer start={startTime} /> 285 + )} 282 286 <Viewers viewers={player.viewers ?? 0} /> 283 287 <Button 284 288 backgroundColor="transparent"