Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <button onclick="getVidNetworkState();" type="button">Get The Network State Of The Current Video/Audio File </button><br>
- <video id="video" width="325" height="325" controls>
- <source src="mov_bbb.mp4" type="video/mp4">
- </video>
- <script>
- var vid = document.getElementById("video");
- vid.src= prompt('Enter Video URL:');
- function getVidNetworkState(str) {
- vid.crossOrign=true;
- if(vid.networkState==3){
- alert('No Video Found!!');
- }
- if(vid.networkState==1){
- alert('Video Was Found!!');
- }
- }
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment