Debug and fix courses watching progress resolution

This commit is contained in:
Adolfo Reyna
2026-02-20 20:52:26 -05:00
parent 058b060d03
commit 83604f5eaa
3 changed files with 106 additions and 19 deletions

View File

@@ -106,7 +106,13 @@ let Media = (props) => {
const renderVideo = () => {
if (videosFiles.length && !props.skiptVideo) {
return loaded ? (
<VideoPlayer videosFiles={videosFiles} poster={poster} videoId={videosId[1]} />
<VideoPlayer
videosFiles={videosFiles}
poster={poster}
postId={props.postId}
profileId={props.post?.profileid}
videoId={videosId[1]}
/>
) : (
<TouchableHighlight onPress={() => setLoaded(true)}>
<Image source={poster ? { uri: poster } : {}} key={poster} style={styles.poster} cachePolicy="memory-disk" />
@@ -123,7 +129,7 @@ let Media = (props) => {
const renderHlsVideo = () => {
if (hlsUrl && !props.skiptVideo) {
return loaded ? (
<VideoPlayer videoUrl={hlsUrl} postId={props.postId} />
<VideoPlayer videoUrl={hlsUrl} postId={props.postId} profileId={props.post?.profileid} />
) : (
<TouchableHighlight onPress={() => {
GlobalState.currentMedia = hlsUrl;
@@ -289,4 +295,4 @@ const styles = StyleSheet.create({
width: "100%",
minHeight: 300,
}
});
});

View File

@@ -43,7 +43,9 @@ const VideoPlayer = ({ videosFiles, postId, profileId, poster, videoUrl, videoSt
postId: postId,
profileId: profileId,
};
//console.log(postId, newData);
if (!GlobalState.me.data) GlobalState.me.data = {};
// Keep local viewer progress in sync so Courses can render immediately.
GlobalState.me.data[postId] = newData;
API.setDataValue(postId, newData);
}
@@ -74,4 +76,4 @@ const styles = StyleSheet.create({
width: 320,
height: 200,
},
});
});