HTML and CSS Reference
In-Depth Information
return
return
Modernizr
.
canvas
;
}
function
function
itemLoaded
(
event
) {
loadCount
++
;
iif
(
loadCount
>=
itemsToLoad
) {
canvasApp
();
}
}
function
function
canvasApp
() {
iif
(
!
canvasSupport
()) {
return
return
;
}
function
function
drawScreen
() {
//Background
context
.
fillStyle
=
"#ffffaa"
;
context
.
fillRect
(
0
,
0
,
theCanvas
.
width
,
theCanvas
.
height
);
//Box
context
.
strokeStyle
=
"#000000"
;
context
.
strokeRect
(
5
,
5
,
theCanvas
.
width
-
10
,
theCanvas
.
height
-
10
);
// Text
context
.
fillStyle
=
"#000000"
;
context
.
fillText
(
"Duration:"
+
audioElement
.
duration
,
20
,
20
);
context
.
fillText
(
"Current time:"
+
audioElement
.
currentTime
,
250
,
20
);
context
.
fillText
(
"Loop: "
+
audioElement
.
loop
,
20
,
40
);
context
.
fillText
(
"Autoplay: "
+
audioElement
.
autoplay
,
250
,
40
);
context
.
fillText
(
"Muted: "
+
audioElement
.
muted
,
20
,
60
);
context
.
fillText
(
"Controls: "
+
audioElement
.
controls
,
250
,
60
);
context
.
fillText
(
"Volume: "
+
audioElement
.
volume
,
20
,
80
);
context
.
fillText
(
"Paused: "
+
audioElement
.
paused
,
250
,
80
);
context
.
fillText
(
"Ended: "
+
audioElement
.
ended
,
20
,
100
);
context
.
fillText
(
"Can Play OGG: "
+
audioElement
.
canPlayType
(
"audio/ogg"
),
250
,
100
);
context
.
fillText
(
"Can Play WAV: "
+
audioElement
.
canPlayType
(
"audio/wav"
),
20
,
120
);
context
.
fillText
(
"Can Play MP3: "
+
audioElement
.
canPlayType
(
"audio/mp3"
),