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({
1465
1465
const target = getEventTarget ( event ) ;
1466
1466
if (
1467
1467
! target ||
1468
+ ! ( target instanceof HTMLMediaElement ) ||
1468
1469
isBlocked ( target as Node , blockClass , blockSelector , true )
1469
1470
) {
1470
1471
return ;
Original file line number Diff line number Diff line change @@ -54,7 +54,14 @@ export class MediaManager {
54
54
this . mediaMap . forEach ( ( _mediaState , target ) => {
55
55
this . syncTargetWithState ( target ) ;
56
56
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
+ }
58
65
}
59
66
} ) ;
60
67
}
@@ -104,7 +111,14 @@ export class MediaManager {
104
111
105
112
target . currentTime = seekToTime ;
106
113
} 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
+ }
108
122
target . currentTime = mediaState . currentTimeAtLastInteraction ;
109
123
}
110
124
}
You can’t perform that action at this time.
0 commit comments