I'm about to create a web-app that shows music videos. I have made some HTML with a video, a playbutton, a canvas where I show some headlines and some titles by the name "Introduction", "Poetry" and "Guitar Single".
I get the headline when the song goes from one segment to the other, although my switch statement does not work, I get an error in line 49.
My javascript looks like this.
I appreciate any input on what I can do wrong :)
var video = 5; Var analyzer; Var canvas; Var time; $ (Function () {video = $ ("video") [0]; $ ("body"). ("Click", "#playbutton", startStopVideo); createAudioAnalyser ();}); Create Function Audio Analyzer () {Reference = New WebKitAudioContact (); Analyzer = reference Creator (); Canvas = $ ('#SoundWave') [0]; Ctx = canvas.getContext ('2d'); Source = context.createMediaElementSource (video); Source.connect (analyzer); Analyser.connect (context.destination); } Function sound animation () {window.requestAnimationFrame (Voice permission); Analyser.fftSize = 128; Fbc_array = New Uint8Array (analyser.frequencyBinCount); Analyser.getByteFrequencyData (fbc_array); Ctx.clearRect (0, 0, canvas wide, canvas.height); Ctx.fillStyle = 'rgba (0, 90, 255,0.3)'; Bar = 120; (Var i = 0; i & lt; times; i ++) for {bar_x = i * 3; Bar_width = 2; Bar_height = - (fbc_array [i]); Ctx.fillRect (bar_x, canvas.height, bar_width, bar_height); }} // This thing is an error set interval (function () (myVid = document.getElementById ("video"); time = parseint (myVid.currentTime, 10); switch (time) {case 2 $ ("# intro" ) .switchClass ("activebox", "inactive box"); // Here is the error ... what is this? Brake;}}, 1000); // --------- start the functionwithdvpvideo () {If (Video Paused) {video.play (); soundAnimation ();} and {video.pause ();}} << Code>
:
case2
should be:
Case 2: // ^ You Missed It
Comments
Post a Comment