@@ -138,6 +138,28 @@ export default function visitBinding(
138
138
139
139
updateConditions = [ `${ last } !== (${ last } = ${ snippet } )` ] ;
140
140
updateElement = `${ state . parentNode } [${ last } ? "pause" : "play"]();` ;
141
+ } else if ( attribute . name === 'buffered' ) {
142
+ const frame = block . getUniqueName ( `${ state . parentNode } _animationframe` ) ;
143
+ block . addVariable ( frame ) ;
144
+ setter = deindent `
145
+ cancelAnimationFrame(${ frame } );
146
+ ${ frame } = requestAnimationFrame(${ handler } );
147
+ ${ setter }
148
+ ` ;
149
+
150
+ updateConditions . push ( `${ snippet } .start` ) ;
151
+ readOnly = true ;
152
+ } else if ( attribute . name === 'seekable' || attribute . name === 'played' ) {
153
+ const frame = block . getUniqueName ( `${ state . parentNode } _animationframe` ) ;
154
+ block . addVariable ( frame ) ;
155
+ setter = deindent `
156
+ cancelAnimationFrame(${ frame } );
157
+ if (!${ state . parentNode } .paused) ${ frame } = requestAnimationFrame(${ handler } );
158
+ ${ setter }
159
+ ` ;
160
+
161
+ updateConditions . push ( `${ snippet } .start` ) ;
162
+ readOnly = true ;
141
163
}
142
164
}
143
165
@@ -213,6 +235,9 @@ function getBindingEventName(node: Node, attribute: Node) {
213
235
if ( attribute . name === 'currentTime' ) return 'timeupdate' ;
214
236
if ( attribute . name === 'duration' ) return 'durationchange' ;
215
237
if ( attribute . name === 'paused' ) return 'pause' ;
238
+ if ( attribute . name === 'buffered' ) return 'progress' ;
239
+ if ( attribute . name === 'seekable' ) return 'timeupdate' ;
240
+ if ( attribute . name === 'played' ) return 'timeupdate' ;
216
241
217
242
return 'change' ;
218
243
}
@@ -317,4 +342,4 @@ function isComputed(node: Node) {
317
342
}
318
343
319
344
return false ;
320
- }
345
+ }
0 commit comments