@@ -34,6 +34,7 @@ export interface AdvancedVideoRef {
3434 pauseAsync : ( ) => Promise < void > ;
3535 setIsMutedAsync : ( isMuted : boolean ) => Promise < void > ;
3636 setPositionAsync : ( positionMillis : number ) => Promise < void > ;
37+ setStatusAsync : ( status : any ) => Promise < void > ;
3738}
3839
3940class AdvancedVideo extends Component < AdvancedVideoProps , AdvancedVideoState > {
@@ -206,7 +207,8 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
206207 public playAsync = async ( ) => {
207208 if ( this . videoRef . current ) {
208209 try {
209- await this . videoRef . current . playAsync ( ) ;
210+ // expo-av uses setStatusAsync for playback control
211+ await this . videoRef . current . setStatusAsync ( { shouldPlay : true } ) ;
210212 } catch ( error ) {
211213 console . warn ( 'Failed to play video:' , error ) ;
212214 }
@@ -216,7 +218,8 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
216218 public pauseAsync = async ( ) => {
217219 if ( this . videoRef . current ) {
218220 try {
219- await this . videoRef . current . pauseAsync ( ) ;
221+ // expo-av uses setStatusAsync for playback control
222+ await this . videoRef . current . setStatusAsync ( { shouldPlay : false } ) ;
220223 } catch ( error ) {
221224 console . warn ( 'Failed to pause video:' , error ) ;
222225 }
@@ -226,7 +229,8 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
226229 public setIsMutedAsync = async ( isMuted : boolean ) => {
227230 if ( this . videoRef . current ) {
228231 try {
229- await this . videoRef . current . setIsMutedAsync ( isMuted ) ;
232+ // expo-av uses setStatusAsync for muting
233+ await this . videoRef . current . setStatusAsync ( { isMuted } ) ;
230234 } catch ( error ) {
231235 console . warn ( 'Failed to set muted state:' , error ) ;
232236 }
@@ -236,13 +240,25 @@ class AdvancedVideo extends Component<AdvancedVideoProps, AdvancedVideoState> {
236240 public setPositionAsync = async ( positionMillis : number ) => {
237241 if ( this . videoRef . current ) {
238242 try {
239- await this . videoRef . current . setPositionAsync ( positionMillis ) ;
243+ // expo-av uses setStatusAsync for seeking
244+ await this . videoRef . current . setStatusAsync ( { positionMillis } ) ;
240245 } catch ( error ) {
241246 console . warn ( 'Failed to set position:' , error ) ;
242247 }
243248 }
244249 } ;
245250
251+ public setStatusAsync = async ( status : any ) => {
252+ if ( this . videoRef . current ) {
253+ try {
254+ // Forward to underlying video component
255+ await this . videoRef . current . setStatusAsync ( status ) ;
256+ } catch ( error ) {
257+ console . warn ( 'Failed to set status:' , error ) ;
258+ }
259+ }
260+ } ;
261+
246262 render ( ) {
247263 const videoUri = this . getVideoUri ( ) ;
248264 console . log ( 'AdvancedVideo - Render:' , {
0 commit comments