@@ -13,20 +13,28 @@ export class MediaStateSync extends MediaPlayerController {
1313 if ( __SERVER__ ) return ;
1414
1515 if ( __DEV__ ) effect ( this . _watchLogLevel . bind ( this ) ) ;
16- effect ( this . _watchMetadata . bind ( this ) ) ;
17- effect ( this . _watchAutoplay . bind ( this ) ) ;
18- effect ( this . _watchClipTimes . bind ( this ) ) ;
19- effect ( this . _watchControls . bind ( this ) ) ;
20- effect ( this . _watchCrossOrigin . bind ( this ) ) ;
21- effect ( this . _watchDuration . bind ( this ) ) ;
22- effect ( this . _watchLive . bind ( this ) ) ;
23- effect ( this . _watchLiveEdge . bind ( this ) ) ;
24- effect ( this . _watchLiveTolerance . bind ( this ) ) ;
25- effect ( this . _watchLoop . bind ( this ) ) ;
26- effect ( this . _watchPlaysInline . bind ( this ) ) ;
27- effect ( this . _watchPoster . bind ( this ) ) ;
28- effect ( this . _watchProvidedTypes . bind ( this ) ) ;
29- effect ( this . _watchTitle . bind ( this ) ) ;
16+
17+ const effects = [
18+ this . _watchMetadata ,
19+ this . _watchAutoplay ,
20+ this . _watchClipStartTime ,
21+ this . _watchClipEndTime ,
22+ this . _watchControls ,
23+ this . _watchCrossOrigin ,
24+ this . _watchDuration ,
25+ this . _watchLive ,
26+ this . _watchLiveEdge ,
27+ this . _watchLiveTolerance ,
28+ this . _watchLoop ,
29+ this . _watchPlaysInline ,
30+ this . _watchPoster ,
31+ this . _watchProvidedTypes ,
32+ this . _watchTitle ,
33+ ] ;
34+
35+ for ( const callback of effects ) {
36+ effect ( callback . bind ( this ) ) ;
37+ }
3038 }
3139
3240 private _init ( ) {
@@ -125,10 +133,18 @@ export class MediaStateSync extends MediaPlayerController {
125133 this . dispatch ( 'plays-inline-change' , { detail : inline } ) ;
126134 }
127135
128- private _watchClipTimes ( ) {
129- const { clipStartTime, clipEndTime } = this . $props ;
130- this . $state . clipStartTime . set ( clipStartTime ( ) ) ;
131- this . $state . clipEndTime . set ( clipEndTime ( ) ) ;
136+ private _watchClipStartTime ( ) {
137+ const { clipStartTime } = this . $props ;
138+ this . dispatch ( 'media-clip-start-change-request' , {
139+ detail : clipStartTime ( ) ,
140+ } ) ;
141+ }
142+
143+ private _watchClipEndTime ( ) {
144+ const { clipEndTime } = this . $props ;
145+ this . dispatch ( 'media-clip-end-change-request' , {
146+ detail : clipEndTime ( ) ,
147+ } ) ;
132148 }
133149
134150 private _watchLive ( ) {
0 commit comments