File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change 2020 const fileButton = document . querySelector ( "input" ) ;
2121 const video = document . querySelector ( 'video' ) ;
2222
23+ // Assumes file has both audio and video tracks
2324 const videoTrackGenerator = new MediaStreamTrackGenerator ( { kind : 'video' } ) ;
2425 const audioTrackGenerator = new MediaStreamTrackGenerator ( { kind : 'audio' } ) ;
2526
Original file line number Diff line number Diff line change @@ -154,14 +154,8 @@ async function start(data) {
154154 }
155155
156156 // Wait until we have a queue of both audio and video samples before rendering
157- // ToDo: Assumes there is both audio and video tracks otherwise it will never play
158157 function render ( ) {
159- if ( rendering ) {
160- // console.log("already rendering");
161- return ;
162- }
163- // start rendering once there is a queue of samples
164- else if ( videoSamples . length > 100 && audioSamples . length > 100 ) {
158+ if ( ! rendering && videoSamples . length > 100 && audioSamples . length > 100 ) {
165159 console . log ( "starting rendering" ) ;
166160 rendering = true ;
167161 renderAudioLoop ( ) ; // this is about ~1 second behind the video
You can’t perform that action at this time.
0 commit comments