Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8737991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:38:44+00:00 2026-06-13T10:38:44+00:00

It works perfect in all major browsers, but not in IE7. The Java script

  • 0

It works perfect in all major browsers, but not in IE7.

The Java script code is:

$(function() {
var $hdVid = jQuery.noConflict();
$hdVid(function() {
    $hdVid('.hd-flv-player').hdVideo();
});
});

JQuery is:

(function($) {

// plugin definition
$.fn.hdVideo = function(options) {
    // build main options before element iteration
    var defaults = {
        theme: 'simpledark',
        childtheme: ''
    };
    var options = $.extend(defaults, options);
    // iterate and reformat each matched element
    return this.each(function() {
        var $hdVideo = $(this);

        $hdVideo.removeAttr('controls');
        //create html structure
        //main wrapper

        var $video_wrap=$('<div id="hd-player"></div>');
        var $video_hd_html_player = $('<div id="hd_html_player"></div>').addClass('hd-video-player').addClass(options.theme).addClass(options.childtheme);
        //controls wraper
        var $video_controls = $('<div class="hd-video-main-control"></div><div class="hd-video-controls"><div class="hd-video-seek-container"><div class="hd-video-seek"></div></div><div class="hd-video-buffer-container"><div class="hd-video-buffer"></div></div><div class="hd-video-options cf"><a class="hd-video-play" title="Play/Pause"></a><div class="hd-video-timer"><span class="hd-video-timer-curr">00:00</span><span class="hd-video-sep">&nbsp;/&nbsp;</span><span class="hd-video-timer-tot-time">00:00</span></div><div class="hd-full-screen"><a class="hd-full-screen-button" title="Normal/FullScreen"></a></div><div class="hd-volume-box"><div class="hd-volume-slider-container"><div class="hd-volume-slider"></div></div><a class="hd-volume-button" title="Mute/Unmute"></a><div class="hd-volume-value-slider"></div></div><div class="hd-hd-swipe"><a class="hd-hd-swipe-button" title="High Definition / Low Definition"></a></div><div class="hd-flv-html5-switch"><a title="Switch to Flash"></a></div></div></div>');
        $video_wrap.append($video_hd_html_player);
        $hdVideo.wrap($video_wrap);
        $hdVideo.after($video_controls);
        var full_screen = 0;
        //get new elements
        var $video_container = $hdVideo.parent('.hd-video-player');
        var $video_main_control = $('.hd-video-main-control', $video_container);
        $video_controls = $('.hd-video-controls', $video_container);
        var $hd_play_btn = $('.hd-video-play', $video_container);
        var $hd_video_seek = $('.hd-video-seek', $video_container);
        var $hd_video_buffer = $('.hd-video-buffer', $video_container);
        var $hd_video_timer_curr = $('.hd-video-timer-curr', $video_container);
        var $hd_video_timer_tot_time = $('.hd-video-timer-tot-time', $video_container);
        var $hd_volume = $('.hd-volume-slider', $video_container);
        var $hd_volume_value = $('.hd-volume-value-slider', $video_container);
        var $hd_volume_btn = $('.hd-volume-button', $video_container);
        var $hd_hd_swipe_btn = $('.hd-hd-swipe-button', $video_container);
        var $hd_full_screen_btn = $('.hd-full-screen-button', $video_container);
        var $player_change_btn = $('.hd-flv-html5-switch', $video_container);
        $video_controls.hide(); // keep the controls hidden
        var firstTime=1;

        /* Video Elements Fetching */
        var videoAttr = {};
        videoAttr.poster = $("video").attr("poster");
        videoAttr.src = $("source").map(function() {
            return $(this).attr("src");
        });
        videoAttr.quality = $("source").map(function() {
            return $(this).attr("data-quality");
        });
        videoAttr.type = $("source").map(function() {
            return $(this).attr("type");
        });
        videoAttr.codecs = $("source").map(function() {
            return $(this).attr("codecs");
        });

        /* Video Elements Fetching Ends */

        /* Poster image into screen image */

        var $video_bind_pst = $('<img class="hd-vid-poster-img" src="'+videoAttr.poster+'" data-width="544" data-height="306"><div class="hd-video-main-control"></div>');
        //$hdVideo.before($video_bind_pst);

        //var
        //width: 630px !important; height: 354px !important; top: 0px !important; left: 0px !important; max-width: 630px !important;

        /* Poster image into screen image ends*/

        /* Play/Pause */
        var gPlay = function() {

            txt =  navigator.platform ;
            if(txt =='iPhone'|| txt =='Linux armv7l')
            {
                window.location.href = videoAttr.src[0];
            }
            else{
                if($hdVideo.attr('paused') == false) {
                    $hdVideo[0].pause();
                    $video_main_control.removeClass("hd-video-main-control-none");
                }
                else {
                    if(firstTime)
                    {
                        $hdVideo.attr('src', vidStatistics.default_vid_src);
                        firstTime=0;
                    }
                    $hdVideo[0].play();
                    $hdVideo.attr('preload', 'auto');
                    $video_main_control.addClass("hd-video-main-control-none");
                    $hdVideo.addClass("video1-visible");
                }
            }
            return false;
        };

        var hd_autoply =$("video").attr("play_auto");
        if(hd_autoply=="autoplay"){
            $hdVideo[0].play();
            $video_main_control.addClass("hd-video-main-control-none");
            $hd_play_btn.addClass('hd-paused-button');
        }

        $video_main_control.click(gPlay);
        $hd_play_btn.click(gPlay);
        $hdVideo.click(gPlay);
        $hdVideo.bind('play', function() {
            $hd_play_btn.addClass('hd-paused-button');
            return false;
        });
        $hdVideo.bind('pause', function() {
            $hd_play_btn.removeClass('hd-paused-button');
            return false;
        });
        $hdVideo.bind('ended', function() {
            $hd_play_btn.removeClass('hd-paused-button');
            $(".hd-video-main-control").removeClass('hd-video-main-control-none');
            return false;
        });

        var gTimeFormat=function(seconds){
            var m=Math.floor(seconds/60)<10?"0"+Math.floor(seconds/60):Math.floor(seconds/60);
            var s=Math.floor(seconds-(m*60))<10?"0"+Math.floor(seconds-(m*60)):Math.floor(seconds-(m*60));
            return m+":"+s;
        };
        /* Play/Pause */

        /* Progressbar Slider */
        var seeksliding;
        var createSeek = function() {
            if($hdVideo.attr('readyState'))
            {
                $hd_video_timer_tot_time.text(gTimeFormat($hdVideo.attr('duration')));
                var video_duration = $hdVideo.attr('duration');
                $hd_video_seek.slider({
                    value: 0,
                    step: 0.01,
                    orientation: "horizontal",
                    range: "min",
                    max: video_duration,
                    animate: true,
                    slide: function(){
                        seeksliding = true;
                    },
                    stop:function(e,ui){
                        seeksliding = false;
                        $hdVideo.attr("currentTime",ui.value);
                    }
                });
                $video_controls.show();
            }
            else {
                setTimeout(createSeek, 150);
            }
            return false;
        };
        createSeek();

        var seekUpdate = function() {
            var currenttime = $hdVideo.attr('currentTime');
            if(!seeksliding)
            {
                $hd_video_seek.slider('value', currenttime);
                $hd_video_timer_curr.text(gTimeFormat(currenttime));
            }
            return false;
        };
        $hdVideo.bind('timeupdate', seekUpdate);
        /* Progressbar Slider */

        /* Buffer Slider */
        var buffersliding;
        var createBuffer = function() {
            if($hdVideo.attr('readyState'))
            {
                $hd_video_timer_tot_time.text(gTimeFormat($hdVideo.attr('duration')));
                var video_duration = $hdVideo.attr('duration');
                $hd_video_buffer.slider({
                    value: 0,
                    step: 0.01,
                    orientation: "horizontal",
                    range: "min",
                    max: video_duration,
                    animate: true,
                    disabled: true,
                    slide: function(){
                        buffersliding = true;
                    },
                    stop:function(e,ui){
                        buffersliding = false;
                        $hdVideo.attr("buffered",ui.value).end(0);
                    }
                });
                $video_controls.show();
            }
            else {
                setTimeout(createBuffer, 150);
            }
            return false;
        };
        createBuffer();

//              var buffertime = $hdVideo.get(0).buffered.end(0);
            var buffertime = $hdVideo[0].buffered.end(0);
            var currenttime = $hdVideo.attr('currentTime');
            if(!buffersliding)
            {
                if(currenttime>buffertime){
                    $hd_video_buffer.slider('value', currenttime);
                }
                else{
                    $hd_video_buffer.slider('value', buffertime);
                }
            }
            return false;
        };
        $hdVideo.bind('timeupdate', bufferUpdate);
        /* Buffer Slider end*/

        /* Volume Control */
        var video_volume = 1;
        $hd_volume.slider({
            value: 0.4,
            orientation: "horizontal",
            range: "min",
            max: 1,
            step: 0.05,
            animate: true,
            slide:function(e,ui){
                $hdVideo.attr('muted',false);
                video_volume = ui.value;
                $hdVideo.attr('volume',ui.value);
                $hd_volume_btn.removeClass('hd-volume-mute');

                if(ui.value*100 == 0) {
                    $hd_volume_btn.css('background-position', '-244px -126px');
                }
                else if(ui.value*100 <= 15) {
                    $hd_volume_btn.css('background-position', '-244px -96px');
                }
                else if (ui.value*100 <= 45) {
                    $hd_volume_btn.css('background-position', '-244px -66px');
                }
                else if (ui.value*100 <= 85) {
                    $hd_volume_btn.css('background-position', '-244px -36px');
                }
                else {
                    $hd_volume_btn.css('background-position', '-244px -6px');
                }
            }
        });

        var muteVolume = function() {
            if($hdVideo.attr('muted')==true) {
                $hdVideo.attr('muted', false);
                $hd_volume.slider('value', video_volume);
                $hd_volume_btn.removeClass('hd-volume-mute');
            }else{
                $hdVideo.attr('muted', true);
                $hd_volume.slider('value', '0');
                $hd_volume_btn.addClass('hd-volume-mute');
            }
            return false;
        };
        /* Volume Control */
        /* Full Screen */
        var fullScreen = function(){
            if(full_screen == 0){
                full_screen = 1;
                $(".hd-video-player").addClass("fullscreen-video-container");
                $(".hd-video-player video.hd-flv-player").addClass("fullscreen-video");
                $(".hd-video-main-control").addClass("fullscreen-hd-video-main-control");
                $(".hd-video-controls").addClass("fullscreen-control-elements");
            }
            else
            {
                full_screen = 0;
                $(".hd-video-player").removeClass("fullscreen-video-container");
                $(".hd-video-player video.hd-flv-player").removeClass("fullscreen-video");
                $(".hd-video-main-control").removeClass("fullscreen-hd-video-main-control");
                $(".hd-video-controls").removeClass("fullscreen-control-elements");
            }
            return false;
        };
        $('body').keydown(function(e){
            if (e.keyCode == 27 && full_screen == 1) {
                fullScreen();
            }
            console.log(e);
            return false;
        });
        /* Full Screen Ends*/

        /* Default Video Quality */
        var defaultVideoQuality = function(videoAttr){
            var vidStatistics = {};
            vidStatistics.support_vid_count=0;
            var i, isSupp, myVid=document.createElement('video');
            for(i=videoAttr.quality.length-1; i>=0; i--)
            {
                path = videoAttr.src[i];
                var path = videoAttr.src[i],
                ext = path.substr(path.lastIndexOf('.') + 1);
                isSupp = myVid.canPlayType('video/'+ext+';');
                if(isSupp=="maybe" || isSupp=="probably" )
                {
                    vidStatistics.default_vid_qty = videoAttr.quality[i];
                    vidStatistics.default_vid_src = videoAttr.src[i];
                    vidStatistics.support_vid_count++;
                }
            }
            if(vidStatistics.default_vid_qty == "hd")
                $("a.hd-hd-swipe-button").addClass("hd-hd-swipe-button-hd");
            else
                $("a.hd-hd-swipe-button").removeClass("hd-hd-swipe-button-hd");

            return(vidStatistics);
        };
        /* Default Video Quality Ends*/

        /* HD Available Check */
        var hdAvailableCheck = function(videoAttr){
            var k=0, i, isSupp, sdSupport = 0;
            var  myVid=document.createElement('video');
            for(i=0; i<videoAttr.quality.length; i++)
            {
                path = videoAttr.src[i];
                var path = videoAttr.src[i],
                ext = path.substr(path.lastIndexOf('.') + 1);
                isSupp = myVid.canPlayType('video/'+ext+';');
                if(isSupp=="maybe" || isSupp=="probably" )
                {
                    if(videoAttr.quality[i]=="hd")
                        k=1;
                    else
                        sdSupport=1;
                }
            }
            if (k==0)
                $hd_hd_swipe_btn.css('display', 'none');
            if (sdSupport==0)
                $hd_hd_swipe_btn.css('pointer-events', 'none').css('cursor', 'default');
            return false;
        }
        /* HD Available Check Ends*/

        /* Video Quality Check*/
        var videoQualityCheck = function(){
            var i, $currVid, currQuality;
            $currVid = $hdVideo[0].currentSrc;
            for(i=0; i<videoAttr.quality.length; i++) //Get current video quality
                if($currVid == videoAttr.src[i])
                    currQuality=videoAttr.quality[i];
            if(currQuality == "hd")
                $("a.hd-hd-swipe-button").addClass("hd-hd-swipe-button-hd");
            else
                $("a.hd-hd-swipe-button").removeClass("hd-hd-swipe-button-hd");
            return false;
        }
        /* Video Quality Check Ends*/

        /* Quality Swipe */
        var playerstage = 0;
        var hdswipe = function(){
            var currVid, currExt, currVidName, currQuality, i;
            if($hdVideo.attr('paused')==false)
                playerstage=1;
            currVid = $hdVideo[0].currentSrc;
            var currVidTime = $hdVideo.attr('currentTime');
            currExt = currVid.substr(currVid.lastIndexOf('.') + 1);
            for(i=0; i<videoAttr.quality.length; i++) //Get current video quality
                if(currVid == videoAttr.src[i])
                    currQuality=videoAttr.quality[i];
            for(i=0; i<videoAttr.quality.length; i++) //Swipe the Video
            {
                if((currExt==videoAttr.src[i].substr(videoAttr.src[i].lastIndexOf('.') + 1))&&(currQuality!= videoAttr.quality[i]))
                {  
                    $hdVideo.attr('src', videoAttr.src[i]);
                    resumeCurrTime(currVidTime);
                    gPlay();
                    createSeek();
                    createBuffer();
                    playerstage=0;
                    break;
                }
            }
            alert(currQuality);
            if(currQuality == "sd")
                $("a.hd-hd-swipe-button").addClass("hd-hd-swipe-button-hd");
            else
                $("a.hd-hd-swipe-button").removeClass("hd-hd-swipe-button-hd");
            return false;
        }

        var resumeCurrTime = function(currVidTime) {
            if($hdVideo.attr('readyState'))
            {
                $hdVideo[0].currentTime = currVidTime;
            }
            else                            
                setTimeout(function() { resumeCurrTime(currVidTime); }, 150);
            return false;
        }
        /* Quality Swipe Ends */

        /* HTML5 / FLV Swipe */
        var playerChangeIntFn = function(){
            if(full_screen==1)
                fullScreen();
            $hdVideo.attr('preload', 'none');
            $hdVideo.load();
            var trigger = "flash";
            playerChange(trigger);
            return false;
        };
        /* HTML5 / FLV Swipe Ends */
        var vidStatistics = {};
        vidStatistics = defaultVideoQuality(videoAttr);
        hdAvailableCheck(videoAttr);
        $hd_hd_swipe_btn.click(hdswipe); //HD On/Off
        $hd_volume_btn.click(muteVolume); //Mute Volume
        $hd_full_screen_btn.click(fullScreen); //Full Screen On/Off
        $video_container.dblclick(fullScreen); //Full Screen On/Off
        $player_change_btn.click(playerChangeIntFn); //Full Screen On/Off
    });
};
// plugin defaults
$.fn.hdVideo.defaults = {
};
})(jQuery);

HTML is:

<video src="" width="830" height="354" class="hd-flv-player" poster="asserts/poster.png" controls="controls" data-name="demo video" data-uid="57fb2708" preload="none">
        <source src="http://video-js.zencoder.com/oceans-clip.mp4" data-quality="hd"></source>
        <source src="http://static.clipcanvas.com/sample/clipcanvas_14348_offline.mp4" data-quality="sd"></source>
        <source src="http://video.webmfiles.org/big-buck-bunny_trailer.webm" data-quality="hd"></source>
        <source src="asserts/300_VP8.webm" data-quality="sd"></source>
    </video>

Doctype: <!DOCTYPE html>

Note: I know that IE7 wont support HTML5 Video. But I just want the control code should be binded. So that I can use Flash Fall back.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:38:45+00:00Added an answer on June 13, 2026 at 10:38 am

    Reply to your comment

    That error is because of ie7 support for “myVid.canPlayType()” in
    JQuery

    Then that needs to be fixed, no? Even though it looks like a third-party library, you can still fix code in them, and even submit bug fixes to the developer. Maybe they even have a later version of the library out, you could check.

    if (myVid.canPlayType)
    

    will check for the existence of the function in the object. If it doesn’t exist, like you said it probably doesn’t support HTML video. You should then exit the plugin with an error, or have an option in the plugin which content should be used as a fallback.

    DEMO

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a html css code. It works perfect on all browsers but
The below code works perfect on XAMPP on my PC, but does not work
I got an app with iCarousel library. All works perfect. But i need cover
I have this code to write to a file, it works perfect but I
I'm having trouble converting this 5 star rating script that works perfect with jquery
I am having problems in Java while managing sessions. All works perfect(I create and
Using this code to zip a folder and it works perfect on small files
i am developing an app which has a evernote integration,everything works perfect but my
This code works perfect for sorting a dynamically created div: <div id='1'>a</div> <div id='2'>b</div>
This is driving me mad , I have a code that works perfect with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.