简体   繁体   English

html页面中的rtsp流vlc; 全屏功能

[英]rtsp streaming vlc in html page; fullscreen function

I am building a website that shows a live streaming video. 我正在建立一个显示实时流视频的网站。 I want to build a single button of it to make a fullscreen of this live streaming. 我想建立一个按钮来全屏显示此直播流。

These are my code: 这些是我的代码:

<title>VLC Mozilla plugin test page</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<body>
    <object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab">
        <!--param name="autostart" value="true" />
        <param name="allowfullscreen" value="false" /-->
        <embed type="application/x-vlc-plugin"
        name="video2"               
        pluginspage="http://www.videolan.org" 
        version="VideoLAN.VLCPlugin.2" 
        autoplay="yes" fullscreen="false" volume="false"
        width="720"height="480" id="vlc" events="True" src="rtsp://100.100.100/video.something"/></embed>

    </object>
        <button>
        fullscreen
        </button>
    <script>
        $( document ).ready(function() {
            $("button").on('click', function(){
            var video = $('object').find('embed');
                console.log("founded");
                video.fullscreen = true;
                if(video.fullscreen === true){
                    console.log('fullscreen now');
                } else
                    console.log('fullscreen not now');


            });
        });
    </script>   

</body>

it cant work properly. 它不能正常工作。 I am so thankfull for every single advice :) 我非常感谢您的每一个建议:)

solved guys! 解决了伙计们! It is not a best way, but it works! 这不是最好的方法,但是有效! I deleted the fullscreen='true' on the embed; 我在嵌入上删除了全屏=“ true”; put an id for it and my a new javascript. 把它的ID和我的新JavaScript。

here is the new one: 这是新的:

<title>VLC Mozilla plugin test page</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<body>
    <object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab">
        <!--param name="autostart" value="true" />
        <param name="allowfullscreen" value="false" /-->
        <embed type="application/x-vlc-plugin"
        id="vlc" 

        pluginspage="http://www.videolan.org" 
        version="VideoLAN.VLCPlugin.2" 
        width="720"height="480" id="vlc" events="True" src="rtsp://host/video.something"/></embed>

    </object>
        <button id="fullscreen">
        fullscreen
        </button>
    <script type="text/javascript">
        $("#fullscreen").click(function () { 
            var a = document.getElementById('vlc').video.toggleFullscreen(); 
        });
    </script>

</body>

but the problem is, it still shows a button fullscreen on the vlc plugin. 但是问题是,它仍然在vlc插件上全屏显示按钮。 I just still to find out how I can disable the fullscreen button on the vlc plugin and make my own button for this fullscreen. 我仍然只是想知道如何禁用vlc插件上的全屏按钮,并为此全屏设置自己的按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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