@@ -5,7 +5,7 @@ import Orientation from 'react-native-orientation-locker';
55import { CONFIG } from "../constants/CONFIG" ;
66
77import { OrientationType } from 'react-native-orientation-locker' ;
8- import type { ErrorData , FullScreenButtonTapData , PlayerStateChangedData } from '@dicetechnology/react-native-vesper-sdk' ;
8+ import type { ErrorData , FullScreenButtonTapData , PlaybackPositionChangedData , PlayerStateChangedData } from '@dicetechnology/react-native-vesper-sdk' ;
99
1010export function Player ( ) {
1111 const playerRef = useRef < PlayerView > ( null ) ;
@@ -62,6 +62,10 @@ export function Player() {
6262 setIsPipActive ( false ) ;
6363 } ;
6464
65+ const handlePlaybackPositionChangedEvent = ( data : PlaybackPositionChangedData ) => {
66+ console . info ( `Event: ${ JSON . stringify ( data ) } ` ) ;
67+ } ;
68+
6569 return (
6670 < View style = { isFullscreen ? styles . fullscreenContainer : styles . container } >
6771 { ! isFullscreen && ! isPipActive &&
@@ -87,7 +91,7 @@ export function Player() {
8791 onPress = { ( ) => {
8892 const source : ResolvableSource = { id : videoId , isLive : isLive } ;
8993 console . info ( 'Loading:' , source ) ;
90- playerRef . current ?. load ( { source : source } ) ;
94+ playerRef . current ?. load ( { source : source , autoPlay : true } ) ;
9195 } }
9296 />
9397 </ View >
@@ -102,7 +106,8 @@ export function Player() {
102106 onHttpErrorEvent = { handleHttpErrorEvent }
103107 onEnterPipEvent = { handleEnterPipEvent }
104108 onExitPipEvent = { handleExitPipEvent }
105- isFullscreenData = { { isFullscreen : isFullscreen } }
109+ onPlaybackPositionChangedEvent = { handlePlaybackPositionChangedEvent }
110+ config = { { toggles : { isFullscreen : isFullscreen , isCloseButtonHidden : false } } }
106111 />
107112 { ! isFullscreen && ! isPipActive &&
108113 < View >
0 commit comments