@@ -949,6 +949,9 @@ export class CustomPlyrControls {
949949 }
950950
951951 private syncPlay = ( ) => {
952+ if ( ! this . controller . context . getIsWritable ( ) ) {
953+ return ;
954+ }
952955 if ( this . PlayButton . classList . contains ( "playing" ) ) {
953956 this . controller . pause ( ) ;
954957 } else {
@@ -970,10 +973,16 @@ export class CustomPlyrControls {
970973 * @param seekTime 播放进度, 单位秒
971974 */
972975 private syncSeek = ( seekTime : number ) => {
976+ if ( ! this . controller . context . getIsWritable ( ) ) {
977+ return ;
978+ }
973979 this . controller . seekTime ( seekTime ) ;
974980 } ;
975981
976982 private eventSeek = ( e : PointerEvent ) => {
983+ if ( ! this . controller . context . getIsWritable ( ) ) {
984+ return ;
985+ }
977986 const offsetX = e . offsetX ;
978987 const width = this . ProgressSliderContainer . offsetWidth ;
979988 const progress = offsetX / width ;
@@ -997,6 +1006,9 @@ export class CustomPlyrControls {
9971006 if ( e . cancelable ) {
9981007 e . preventDefault ( ) ;
9991008 }
1009+ if ( ! this . controller . context . getIsWritable ( ) ) {
1010+ return ;
1011+ }
10001012 this . _isDraggingProgress = true ;
10011013 const offsetX = e . offsetX + this . ProgressSliderButton . offsetLeft ;
10021014 this . dragStartX = [ e . clientX , offsetX ] ;
@@ -1009,6 +1021,9 @@ export class CustomPlyrControls {
10091021 if ( e . cancelable ) {
10101022 e . preventDefault ( ) ;
10111023 }
1024+ if ( ! this . controller . context . getIsWritable ( ) ) {
1025+ return ;
1026+ }
10121027 if ( ! this . dragStartX ) {
10131028 return ;
10141029 }
@@ -1029,6 +1044,9 @@ export class CustomPlyrControls {
10291044 if ( e . cancelable ) {
10301045 e . preventDefault ( ) ;
10311046 }
1047+ if ( ! this . controller . context . getIsWritable ( ) ) {
1048+ return ;
1049+ }
10321050 if ( ! this . dragStartX ) {
10331051 return ;
10341052 }
0 commit comments