Commit 4d7df94c authored by Xiaowu Zhang's avatar Xiaowu Zhang

disable video player when file's mp3

parent 44b67a6e
...@@ -132,6 +132,13 @@ ...@@ -132,6 +132,13 @@
type: "indexeddb", type: "indexeddb",
database: "test" database: "test"
}); });
}).push(function() {
var controlPanel = g.__element.getElementsByClassName("page")[0];
if (controlPanel) {
while (controlPanel.firstChild) {
controlPanel.removeChild(controlPanel.firstChild);
}
}
}); });
}).declareMethod("render", function(options) { }).declareMethod("render", function(options) {
var gadget = this, page_gadget, element, page_element; var gadget = this, page_gadget, element, page_element;
......
...@@ -103,7 +103,6 @@ ...@@ -103,7 +103,6 @@
gradient.addColorStop(.5, "#ff0"); gradient.addColorStop(.5, "#ff0");
gradient.addColorStop(0, "#f00"); gradient.addColorStop(0, "#f00");
that.audio.play(); that.audio.play();
that.video.play();
drawFrame = function() { drawFrame = function() {
array = getFFTValue(that); array = getFFTValue(that);
canvasCtx.clearRect(0, 0, cwidth, cheight); canvasCtx.clearRect(0, 0, cwidth, cheight);
...@@ -126,6 +125,7 @@ ...@@ -126,6 +125,7 @@
that.video.style.display = "none"; that.video.style.display = "none";
return promiseRequestAnimation(drawFrame); return promiseRequestAnimation(drawFrame);
} }
that.video.play();
that.video.style.display = ""; that.video.style.display = "";
canvas.style.display = "none"; canvas.style.display = "none";
return promiseRequestAnimation(showTime); return promiseRequestAnimation(showTime);
......
...@@ -159,6 +159,14 @@ ...@@ -159,6 +159,14 @@
{ "type" : "indexeddb", { "type" : "indexeddb",
"database" : "test"} "database" : "test"}
); );
})
.push(function () {
var controlPanel = g.__element.getElementsByClassName('page')[0];
if (controlPanel) {
while (controlPanel.firstChild) {
controlPanel.removeChild(controlPanel.firstChild);
}
}
}); });
}) })
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
......
...@@ -141,7 +141,6 @@ ...@@ -141,7 +141,6 @@
gradient.addColorStop(0.5, '#ff0'); gradient.addColorStop(0.5, '#ff0');
gradient.addColorStop(0, '#f00'); gradient.addColorStop(0, '#f00');
that.audio.play(); that.audio.play();
that.video.play();
drawFrame = function () { drawFrame = function () {
array = getFFTValue(that); array = getFFTValue(that);
canvasCtx.clearRect(0, 0, cwidth, cheight); canvasCtx.clearRect(0, 0, cwidth, cheight);
...@@ -169,6 +168,7 @@ ...@@ -169,6 +168,7 @@
that.video.style.display = "none"; that.video.style.display = "none";
return promiseRequestAnimation(drawFrame); return promiseRequestAnimation(drawFrame);
} }
that.video.play();
that.video.style.display = ""; that.video.style.display = "";
canvas.style.display = "none"; canvas.style.display = "none";
return promiseRequestAnimation(showTime); return promiseRequestAnimation(showTime);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment