Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
jimukgb authored Dec 5, 2024
1 parent e982954 commit c098787
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
<script>
function play()
{
document.getElementById("player").innerHTML =
(
document.getElementById("player").children[0].nodeName=="TEXTAREA"?
"<video controls><source src='" + document.getElementById("player").children[0].value + "'></video>":
"<textarea></textarea>"
);
if(document.getElementById("player").children[0].nodeName=="TEXTAREA")
{
document.getElementById("player").innerHTML = "<video controls><source src='" + document.getElementById("player").children[0].value + "'></video>";
document.getElementById("control").innerText = "RESET";
}
else
{
document.getElementById("player").innerHTML = "<textarea></textarea>";
document.getElementById("control").innerText = "PLAY";
}
}
</script>
<style>
Expand All @@ -30,7 +34,7 @@
<div id="player"><textarea></textarea></div>
<br><br><br>
<div>
<button onclick="play()">PLAY</button>
<button id="control" onclick="play()">PLAY</button>
</div>
</body>
</html>

0 comments on commit c098787

Please sign in to comment.