수고하십니다
동영상목록을 현재창에서 재생하는 태그인데 편집기에 소스 넣고 실행후
동작을 하지않아 소스편집기 열어보면 <script> 영역이 없습니다
스크립트부분을 정상동작 시킬수 없는지요
부탁드립니다
-------------------------------
<!DOCTYPE html>
<html>
<head>
<title>video playlist</title>
</head>
<body>
<figure id="video_player">
<video controls width="700px">
<source src="1.mp4" type="video/mp4">
<source src="1.webm" type="video/webm">
</video>
<figcaption>
<ui>
<li><a href="1.mp4">play video 1</a></li>
<li><a href="2.mp4">play video 2</a></li>
<li><a href="3.mp4">play video 3</a></li>
</ui>
</figcaption>
</figure>
</body>
</html>
----------------아래태그가 사라집니다----------------------
<script type="text/javascript">
var video_player=document.getElementById("video_player"),
links=video_player.getElementsByTagName('a');
for(var i=0; i<links.length; i++){
links[i].onclick=handler;
}
function handler(e){
e.preventDefault();
videotarget=this.getAttribute("href");
filename=videotarget.substr(0,videotarget.lastIndexOf('.'))||videotarget;
video=document.querySelector("#video_player video");
video.removeAttribute('poster');
source=document.querySelectorAll("#video_player video source");
source[0].src=filename + ".mp4";
source[1].src=filename + ".webm";
video.load();
video.play();
}
</script>
관리자가 아닌 회원이나 비회원이 '편집기'에 스크립트 코드를 삽입하면 보안 문제로 자동 필터링되는 걸로 알고 있습니다.
애드온 등을 통해 스크립트를 실행시켜야 할 것으로 보이네요.