Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1.  
  2.  
  3. <html>
  4. <title>VLC Mozilla plugin test page</title>
  5. <body>
  6. <div id="block" style="width: 100%;">
  7. <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
  8. width="640"
  9. height="480"
  10. id="vlc"
  11. controls ="false">
  12. </embed>
  13. </div>
  14. <button id="test">...</button>
  15.  
  16. <script language="Javascript">
  17. var e = document.getElementById("test");
  18. var b = document.getElementById("block");
  19. e.onclick = function() {
  20.  
  21. if (RunPrefixMethod(document, "FullScreen") || RunPrefixMethod(document, "IsFullScreen")) {
  22. RunPrefixMethod(document, "CancelFullScreen");
  23. vlc.width = "640"
  24. vlc.height = "480"
  25. }
  26. else {
  27. vlc.width = "100%"
  28. vlc.height = "100%"
  29. RunPrefixMethod(b, "RequestFullScreen");
  30. }
  31.  
  32. }
  33.  
  34. var pfx = ["webkit", "moz", "ms", "o", ""];
  35. function RunPrefixMethod(obj, method) {
  36.  
  37. var p = 0, m, t;
  38. while (p < pfx.length && !obj[m]) {
  39. m = method;
  40. if (pfx[p] == "") {
  41. m = m.substr(0,1).toLowerCase() + m.substr(1);
  42. }
  43. m = pfx[p] + m;
  44. t = typeof obj[m];
  45. if (t != "undefined") {
  46. pfx = [pfx[p]];
  47. return (t == "function" ? obj[m]() : obj[m]);
  48. }
  49. p++;
  50. }
  51.  
  52. }
  53.  
  54. var vlc = document.getElementById("vlc");
  55. vlc.audio.toggleMute();
  56. </script>
  57. </body>
  58. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement