简体   繁体   中英

how to open video in new window with all browser supports

I want to open one .mp4 video in new window on clicking a link.

now, i am using this function to open new window:

function showCreateProfilePopup()
            {
                var myAjax = $.ajax({
                    url: '<?php echo $this->config->item('url'); ?>info/createProfileVideo',
                    type: "POST",
                    success: function(response) {
                        var windowWidth = 625;
                        var windowHeight = 500;
                        var centerWidth = (window.screen.width - windowWidth) / 2;
                        var centerHeight = (window.screen.height - windowHeight) / 2;
                        myWindow = window.open('','Video','width='+windowWidth+', height='+windowHeight+',scrollbars=no,resizable=no, innerWidth='+windowWidth+', innerHeight='+windowHeight+',left='+centerWidth+',top='+centerHeight);
                        myWindow.document.write(response);
                        myWindow.focus();
                    }
                });
            }

Definitely it opens window but, not same size for all Browser .

and after that it post to another view with one video like :

<video controls="controls" poster="<?php echo $this->config->item('content_url'); ?>/images/scrublyVideo.png" width="610" height="450">
    <source src="<?php echo $this->config->item('content_url'); ?>video/createProfileHelpVideo.mp4" type="video/mp4" />
    <object width='610' height='450' id='player' name='player'>
        <param name="movie" value="<?php echo $this->config->item('content_url'); ?>video/createProfileHelpVideo.mp4" />
        <param name="allowFullScreen" value="true" />
        <param name="wmode" value="transparent" />
        <param name="autoStart" value="false">
        <img alt="Scrubly" src="<?php echo $this->config->item('content_url'); ?>/images/scrublyVideo.png" width="640" height="360" title="Scrubly Create Profile Help" />
        <embed src='<?php echo $this->config->item('content_url'); ?>video/createProfileHelpVideo.mp4' type='Svideo/mp4' allowfullscreen='true' allowscriptaccess='always' width='600' height='450'/>
    </object>
</video>

anyone tell me the easiest way to open video which supports by all the browsers(Mozilla, Chrome and safari) ?????

-Thanks a lot....

Okey, i got the answer by using jwPlayer library.

-Thanks for your valuable response...

http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/22420/embedding-with-webm-and-mp4-source/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM