Initial commit
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>go2rtc - WebRTC</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="out"></div>
|
||||
<script>
|
||||
const out = document.getElementById("out");
|
||||
|
||||
const print = (name, caps) => {
|
||||
out.innerText += name + "\n";
|
||||
caps.codecs.forEach((codec) => {
|
||||
out.innerText += [codec.mimeType, codec.channels, codec.clockRate, codec.sdpFmtpLine] + "\n";
|
||||
});
|
||||
out.innerText += "\n";
|
||||
}
|
||||
|
||||
if (RTCRtpReceiver.getCapabilities) {
|
||||
print("receiver video", RTCRtpReceiver.getCapabilities("video"));
|
||||
print("receiver audio", RTCRtpReceiver.getCapabilities("audio"));
|
||||
print("sender video", RTCRtpSender.getCapabilities("video"));
|
||||
print("sender audio", RTCRtpSender.getCapabilities("audio"));
|
||||
}
|
||||
|
||||
const types = [
|
||||
'video/mp4; codecs="avc1.42401E"',
|
||||
'video/mp4; codecs="avc1.42C01E"',
|
||||
'video/mp4; codecs="avc1.42E01E"',
|
||||
'video/mp4; codecs="avc1.42001E"',
|
||||
'video/mp4; codecs="avc1.4D401E"',
|
||||
'video/mp4; codecs="avc1.4D001E"',
|
||||
'video/mp4; codecs="avc1.640032"',
|
||||
'video/mp4; codecs="avc1.640C32"',
|
||||
'video/mp4; codecs="avc1.F4001F"',
|
||||
'video/mp4; codecs="hvc1.016000"',
|
||||
];
|
||||
|
||||
const video = document.createElement("video");
|
||||
out.innerText += "video.canPlayType\n";
|
||||
types.forEach(type => {
|
||||
out.innerText += type + "=" + (video.canPlayType(type) ? "true" : "false") + "\n";
|
||||
})
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user