mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 05:13:04 +03:00
post detail view now support start time passing
This commit is contained in:
parent
d651fb06ad
commit
135d774b49
@ -32,6 +32,7 @@ const PostBody = ({ navigation, body, dispatch, onLoadEnd }) => {
|
||||
const [html, setHtml] = useState('');
|
||||
const [youtubeVideoId, setYoutubeVideoId] = useState(null);
|
||||
const [videoUrl, setVideoUrl] = useState(null);
|
||||
const [videoStartTime, setVideoStartTime] = useState(0);
|
||||
|
||||
const intl = useIntl();
|
||||
const actionImage = useRef(null);
|
||||
@ -44,9 +45,10 @@ const PostBody = ({ navigation, body, dispatch, onLoadEnd }) => {
|
||||
}
|
||||
}, [body]);
|
||||
|
||||
const _handleYoutubePress = (videoId) => {
|
||||
const _handleYoutubePress = (videoId, startTime) => {
|
||||
if (videoId && youtubePlayerRef.current) {
|
||||
setYoutubeVideoId(videoId);
|
||||
setVideoStartTime(startTime);
|
||||
youtubePlayerRef.current.setModalVisible(true);
|
||||
}
|
||||
};
|
||||
@ -54,6 +56,7 @@ const PostBody = ({ navigation, body, dispatch, onLoadEnd }) => {
|
||||
const _handleVideoPress = (embedUrl) => {
|
||||
if (embedUrl && youtubePlayerRef.current) {
|
||||
setVideoUrl(embedUrl);
|
||||
setVideoStartTime(0);
|
||||
youtubePlayerRef.current.setModalVisible(true);
|
||||
}
|
||||
};
|
||||
@ -291,7 +294,11 @@ const PostBody = ({ navigation, body, dispatch, onLoadEnd }) => {
|
||||
setVideoUrl(null);
|
||||
}}
|
||||
>
|
||||
<VideoPlayerSheet youtubeVideoId={youtubeVideoId} videoUrl={videoUrl} />
|
||||
<VideoPlayerSheet
|
||||
youtubeVideoId={youtubeVideoId}
|
||||
videoUrl={videoUrl}
|
||||
startTime={videoStartTime}
|
||||
/>
|
||||
</ActionSheetView>
|
||||
|
||||
<OptionsModal
|
||||
|
Loading…
Reference in New Issue
Block a user