javascript - Show iframe or div inside video tag after video end -
i have video tag :
<video id="test" autobuffer style="width:100%;" onclick="this.play(); controls> <source src="some file" type="video/mp4"> </video> and javascript :
<script type='text/javascript'> var video = document.getelementsbytagname('test')[0]; video.onended = function(e) { document.getelementbyid('test').innerhtml= '<iframe src="http://www.example.com/myframe" width="100" height="100"></iframe>'; }; </script> idea ,when video end (video.onended) show iframe or div in video tag. advertisment info..
i try,but no succes..
tnx,
you need replace whole video element rather try , replace child within it. use parentnode video elements parent
document.getelementbyid('test').parentnode.innerhtml= '<iframe src="http://www.example.com/myframe" width="100" height="100"></iframe>';
Comments
Post a Comment