Adds static www content to binary
This commit is contained in:
+1
-2
@@ -15,8 +15,7 @@
|
||||
);
|
||||
|
||||
const header = document.getElementById('header');
|
||||
header.innerHTML = `<a href="api/stats">stats</a>` +
|
||||
`<a href="webcam.html?url=webcam">webcam</a>`;
|
||||
header.innerHTML = `<a href="api/stats">stats</a>`;
|
||||
|
||||
const links = [
|
||||
'<a href="webrtc-async.html?url={name}">webrtc-async</a>',
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package www
|
||||
|
||||
import "embed"
|
||||
|
||||
//go:embed *.html
|
||||
var Static embed.FS
|
||||
@@ -21,11 +21,8 @@
|
||||
background: black;
|
||||
}
|
||||
</style>
|
||||
<!-- Fix bugs for example with Safari... -->
|
||||
<!-- <script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>-->
|
||||
</head>
|
||||
<body>
|
||||
<!-- muted is important for autoplay -->
|
||||
<video id="video" autoplay controls playsinline muted></video>
|
||||
<script>
|
||||
function init(stream) {
|
||||
@@ -38,11 +35,7 @@
|
||||
ws.onopen = () => {
|
||||
console.debug('ws.onopen');
|
||||
|
||||
pc.createOffer({
|
||||
// this is adds two media to SDP with recvonly direction
|
||||
// offerToReceiveAudio: true,
|
||||
// offerToReceiveVideo: true,
|
||||
}).then(offer => {
|
||||
pc.createOffer().then(offer => {
|
||||
pc.setLocalDescription(offer).then(() => {
|
||||
console.log(offer.sdp);
|
||||
const msg = {type: 'webrtc/offer', value: pc.localDescription.sdp};
|
||||
|
||||
Reference in New Issue
Block a user