зеркало из https://github.com/mozilla/popcorn-js.git
tic #115 javascript command demo
This commit is contained in:
Родитель
e15b320ee5
Коммит
ce1f101e1c
|
@ -0,0 +1,40 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="http://code.jquery.com/jquery.js"></script>
|
||||
<script src="../../popcorn.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="videoContainer" style="text-align:center;">
|
||||
<video src="http://scotland.proximity.on.ca/sdowne/dutch.ogg" controls data-timeline-sources="jscommand.xml"></video>
|
||||
</div>
|
||||
<div id="content"><div>
|
||||
<script>
|
||||
var customJS = (function() {
|
||||
var interval;
|
||||
var content = document.getElementById("content");
|
||||
|
||||
function work() {
|
||||
var item = document.createElement("p");
|
||||
item.innerHTML = "working...";
|
||||
content.appendChild(item);
|
||||
}
|
||||
|
||||
return {
|
||||
start: function() {
|
||||
var item = document.createElement("p");
|
||||
item.innerHTML = "starting...";
|
||||
content.appendChild(item);
|
||||
interval = setInterval(work, 1000);
|
||||
},
|
||||
stop: function() {
|
||||
var item = document.createElement("p");
|
||||
item.innerHTML = "done!";
|
||||
content.appendChild(item);
|
||||
clearInterval(interval);
|
||||
}
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<popcorn>
|
||||
<timeline>
|
||||
<javascript in="1" out="10" start="customJS.start" stop="customJS.stop"/>
|
||||
</timeline>
|
||||
</popcorn>
|
Загрузка…
Ссылка в новой задаче