Announcement

Collapse
No announcement yet.

HTML5 Video

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTML5 Video

    I just recently read that iOS devices do not support Adobe Flash, go figure

    Instead, I want to check if Flash is present and if it isn't, then present alternative content, whether it's HTML5 or something else. I was wondering if this was covered in a previous post, or maybe someone could point me to a good source on how to set this up, id appreciate it

  • #2
    Hi there webmast3r,

    try this script...
    Code:
    
    <script>
    (function() {
       'use strict';
    
    function detectflash() {
    if((navigator.plugins!=null)&&(navigator.plugins.length>0)) {
       return (navigator.plugins["Shockwave Flash"])&&(true);
     }
    if(~navigator.userAgent.toLowerCase().indexOf("webtv")) {
       return true;
     }
    if((~navigator.appVersion.indexOf("MSIE"))&&(!~navigator.userAgent.indexOf("Opera"))) {
    try {
       return (new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))&&(true);
     }
       catch(e){}
     }
       return false;
     }
    if(detectflash()) {
       alert('Flash is enabled');
     } 
    else {
       alert('Flash is not available');
     }
    })();
    </script>
    Replace the alerts with your alternative content.

    Source:-
    Detect Flash with JavaScript
    Last edited by coothead; 05-08-2014, 06:24 PM. Reason: tpynig eorrr


    ~ the original bald headed old fart ~

    Comment

    Working...
    X