mirror of
https://github.com/lkmio/lkm.git
synced 2025-09-27 03:26:01 +08:00
取消参数携带.rtc后缀
This commit is contained in:
5
rtc.html
5
rtc.html
@@ -32,7 +32,7 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div style="margin-top: 10px; margin-left: 10px;">
|
<div style="margin-top: 10px; margin-left: 10px;">
|
||||||
<input style="width: 100px;" id="url" type="text" value="hls/mystream.rtc"/>
|
<input style="width: 100px;" id="source" type="text" value="hls/mystream"/>
|
||||||
<button onclick="play()"> 播放</button>
|
<button onclick="play()"> 播放</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<script>
|
<script>
|
||||||
async function play() {
|
async function play() {
|
||||||
let remote_view = document.getElementById("videoview");
|
let remote_view = document.getElementById("videoview");
|
||||||
let url = document.getElementById("url").value;
|
let source = document.getElementById("source").value;
|
||||||
let pc = new RTCPeerConnection(null);
|
let pc = new RTCPeerConnection(null);
|
||||||
// pc.addTransceiver("audio", {direction: "recvonly"});
|
// pc.addTransceiver("audio", {direction: "recvonly"});
|
||||||
pc.addTransceiver("video", {direction: "recvonly"});
|
pc.addTransceiver("video", {direction: "recvonly"});
|
||||||
@@ -80,6 +80,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log("offer:" + offer.sdp);
|
console.log("offer:" + offer.sdp);
|
||||||
|
let url = source + ".rtc";
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
|
Reference in New Issue
Block a user