-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
97 lines (90 loc) · 3.68 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>VideoChat</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">VideoChat(手動SDP+全画面キャプチャ)</a>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-6">
<center>
<button type="button" onclick="startVideo();">Start Video</button>
<button type="button" onclick="stopVideo();">Stop Video</button>
<p><a href="#" class="pure-button pure-button-success" id="start-screen">スクリーンシェア</a></p>
</center>
<br />
<video id="local_video" autoplay style="width: 480px; height: 360px; border: 1px solid black;"></video>
<br>
<p>SDP to send:<br />
<textarea id="text_for_send_sdp" rows="5" cols="60" readonly="readonly">SDP to send</textarea>
</p>
</div>
<div class="col-md-6">
<center>
<button type="button" onclick="connect();">Connect</button>
<button type="button" onclick="hangUp();">Hang Up</button>
</center>
<br />
<video id="remote_video" autoplay style="width: 480px; height: 360px; border: 1px solid black;"></video>
<p>SDP to receive:
<button type="button" onclick="onSdpText();">Receive remote SDP</button><br />
<textarea id="text_for_receive_sdp" rows="5" cols="60"></textarea>
</p>
</div>
</div>
</div>
<script src="js/jquary.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script type='text/javascript' src='./webrtc.js'></script>
<script src="js/fullscreen.js"></script>
<script src="https://skyway.io/dist/screenshare.js"></script>
<script src="https://skyway.io/dist/screenshare.min.js"></script>
<script>
// var elem = document.getElementById("local_video");
// if (elem.requestFullscreen) {
// elem.requestFullscreen();
// }
// var elem = document.getElementById("remote_video");
// if (elem.requestFullscreen) {
// elem.requestFullscreen();
// }
var videoElement = document.getElementById("remote_video");
function toggleFullScreen() {
if (!document.mozFullScreen && !document.webkitFullScreen) {
if (videoElement.mozRequestFullScreen) {
videoElement.mozRequestFullScreen();
} else {
videoElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else {
document.webkitCancelFullScreen();
}
}
}
document.addEventListener("keydown", function(e) {
if (e.keyCode == 13) {
toggleFullScreen();
}
}, false);
var screen = new SkyWay.ScreenShare({
debug: true
});
</script>
</body>
</html>