溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

nginx-http-flv-module flv拉流錯誤有哪些

發(fā)布時間:2021-12-10 16:29:41 來源:億速云 閱讀:241 作者:iii 欄目:大數(shù)據(jù)

這篇文章主要介紹“nginx-http-flv-module flv拉流錯誤有哪些”,在日常操作中,相信很多人在nginx-http-flv-module flv拉流錯誤有哪些問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”nginx-http-flv-module flv拉流錯誤有哪些”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

1.flv拉流錯誤

Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD

在video標(biāo)簽中加入 muted 即可

<video muted id="videoElement" class="centeredVideo" controls autoplay width="1024" height="576">
Your browser is too old which doesn't support HTML5 video.
</video>

2.HTML采用flv.js與dplayer播放器來播放http-flv格式視頻時,請求nignx服務(wù)器遇到了chrom跨域的問題

Access to fetch at ‘http://192.168.31.66:9999/zzh-1586620072-2020-04-11-23_47_52.flv’ from origin ‘http://localhost:8080’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

http{
    server {
        listen      8000;
        server_name localhost;
        add_header 'Access-Control-Allow-Origin' '*'; #允許所有來源訪問
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE'; #允許訪問的方式

3.推流權(quán)限控制

rtmp {  
    server {  
        listen 1935;  #監(jiān)聽的端口
        chunk_size 4000;
        application myapp {
            live on;
            notify_method get;
            publish_notify on;
            on_publish http://192.168.0.103:8087/autho/rtmp; #這里進行權(quán)限控制
			on_publish_done http://127.0.0.1:8087/autho/rtmpOver;#直播結(jié)束回調(diào)
        }  
        application hls {
            live on;
            hls on;
            hls_path /home/soap/rtmp/hls;#視頻流存放地址
            hls_fragment 5s;
            hls_playlist_length 15s;
            hls_continuous on; #連續(xù)模式。
            hls_cleanup on;    #對多余的切片進行刪除。
            hls_nested on;     #嵌套模式。
        }
    }  
}

4.flv拉取流的路徑

http://example.com[:port]/dir?[port=xxx&]app=appname&stream=streamname

http://127.0.0.1:8000/live?app=myapp&stream=fhx

port默認(rèn)為1935

myapp為配置路徑

fhx為流路徑

5.obs設(shè)置

nginx-http-flv-module flv拉流錯誤有哪些

6.效果圖

nginx-http-flv-module flv拉流錯誤有哪些

到此,關(guān)于“nginx-http-flv-module flv拉流錯誤有哪些”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注億速云網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>

向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI