Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <title>VLC Mozilla plugin test page</title>
- <body>
- <div id="block" style="width: 100%;">
- <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
- width="640"
- height="480"
- id="vlc"
- controls ="false">
- </embed>
- </div>
- <button id="test">...</button>
- <script language="Javascript">
- var e = document.getElementById("test");
- var b = document.getElementById("block");
- e.onclick = function() {
- if (RunPrefixMethod(document, "FullScreen") || RunPrefixMethod(document, "IsFullScreen")) {
- RunPrefixMethod(document, "CancelFullScreen");
- vlc.width = "640"
- vlc.height = "480"
- }
- else {
- vlc.width = "100%"
- vlc.height = "100%"
- RunPrefixMethod(b, "RequestFullScreen");
- }
- }
- var pfx = ["webkit", "moz", "ms", "o", ""];
- function RunPrefixMethod(obj, method) {
- var p = 0, m, t;
- while (p < pfx.length && !obj[m]) {
- m = method;
- if (pfx[p] == "") {
- m = m.substr(0,1).toLowerCase() + m.substr(1);
- }
- m = pfx[p] + m;
- t = typeof obj[m];
- if (t != "undefined") {
- pfx = [pfx[p]];
- return (t == "function" ? obj[m]() : obj[m]);
- }
- p++;
- }
- }
- var vlc = document.getElementById("vlc");
- vlc.audio.toggleMute();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement