File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1465,6 +1465,7 @@ function initMediaInteractionObserver({
14651465 const target = getEventTarget ( event ) ;
14661466 if (
14671467 ! target ||
1468+ ! ( target instanceof HTMLMediaElement ) ||
14681469 isBlocked ( target as Node , blockClass , blockSelector , true )
14691470 ) {
14701471 return ;
Original file line number Diff line number Diff line change @@ -54,7 +54,14 @@ export class MediaManager {
5454 this . mediaMap . forEach ( ( _mediaState , target ) => {
5555 this . syncTargetWithState ( target ) ;
5656 if ( options . pause ) {
57- target . pause ( ) ;
57+ try {
58+ target . pause ( ) ;
59+ } catch ( error ) {
60+ this . warn (
61+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions
62+ `Failed to sync media element: ${ error . message || error } ` ,
63+ ) ;
64+ }
5865 }
5966 } ) ;
6067 }
@@ -104,7 +111,14 @@ export class MediaManager {
104111
105112 target . currentTime = seekToTime ;
106113 } else {
107- target . pause ( ) ;
114+ try {
115+ target . pause ( ) ;
116+ } catch ( error ) {
117+ this . warn (
118+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions
119+ `Failed to pause during seek: ${ error . message || error } ` ,
120+ ) ;
121+ }
108122 target . currentTime = mediaState . currentTimeAtLastInteraction ;
109123 }
110124 }
You can’t perform that action at this time.
0 commit comments