HTML5 Video Stop onClose

后端 未结 9 882
暗喜
暗喜 2020-12-10 11:23

I\'m using jQuery tools for an overlay. Inside the overlay I have an HTML5 video. However, when I close the overlay, the video keeps playing. Any idea how I might get the vi

9条回答
  •  情书的邮戳
    2020-12-10 12:11

    Starting Video with different browsers

    For Opera 12

    window.navigator.getUserMedia(param, function(stream) {
                                video.src =window.URL.createObjectURL(stream);
                            }, videoError );
    

    For Firefox Nightly 18.0

    window.navigator.mozGetUserMedia(param, function(stream) {
                                video.mozSrcObject = stream;
                            }, videoError );
    

    For Chrome 22

    window.navigator.webkitGetUserMedia(param, function(stream) {
                                video.src =window.webkitURL.createObjectURL(stream);
                            },  videoError );
    

    Stopping video with different browsers

    For Opera 12

    video.pause();
    video.src=null;
    

    For Firefox Nightly 18.0

    video.pause();
    video.mozSrcObject=null;
    

    For Chrome 22

    video.pause();
    video.src="";
    

提交回复
热议问题