Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/254.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在具有所有浏览器支持的新窗口中打开视频_Php_Javascript - Fatal编程技术网

Php 如何在具有所有浏览器支持的新窗口中打开视频

Php 如何在具有所有浏览器支持的新窗口中打开视频,php,javascript,Php,Javascript,我想在新窗口中单击链接打开一个.mp4视频 现在,我正在使用此功能打开新窗口: function showCreateProfilePopup() { var myAjax = $.ajax({ url: '<?php echo $this->config->item('url'); ?>info/createProfileVideo',

我想在新窗口中单击链接打开一个.mp4视频

现在,我正在使用此功能打开新窗口:

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();
                    }
                });
            }
函数showCreateProfilePopup()
{
var myAjax=$.ajax({
url:'info/createProfileVideo',
类型:“POST”,
成功:功能(响应){
var windowWidth=625;
var窗高=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,Resizeable=no,innerWidth='+windowWidth+',innerHeight='+windowHeight+',left='+centerWidth+',top='+centerHeight);
myWindow.document.write(响应);
myWindow.focus();
}
});
}
它肯定会打开窗口,但并非所有浏览器的大小都相同

之后,它会通过一个视频发布到另一个视图 喜欢 :

好的, 我通过使用jwPlayer库得到了答案

-谢谢你宝贵的回复


并非所有浏览器都支持

:IE9+、Chrome 6+、Firefox 3.6+、Safari 5+、Opera 10.6+。并非所有浏览器都支持这3种类型的视频(MP4、WebM和OGG)。因此,您不可能拥有适用于所有浏览器的完全有效的
。您已经使用html目标在单击时打开窗口,但不知道视频支持
<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>