-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
160 lines (122 loc) · 3.67 KB
/
index.html
File metadata and controls
160 lines (122 loc) · 3.67 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<html>
<head>
<title>
Web
</title>
<style type="text/css">
</style>
</head>
<body>
<a id="link">download</a><br>
<button id="btn">played</button>
<br>
<button onclick="media()">Start()</button>
<!-- <canvas id="can"></canvas> -->
<button onclick="viewImage()">viewImage</button>
<button onclick="capture()">Capture Image</button>
<button onclick="color()">colorChange</button>
<div id="onface" style="display: none">
<img id="im">
</div>
<!-- thi sis impptrat -->
<canvas id="imageEdit"></canvas>
<canvas id="imagefinal"></canvas><br>
<h2>only for test</h2>
<button id="test">click to blob</button>
<br>
<canvas id="testcan"></canvas>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript" src="main.js">
</script>
<script type="text/javascript">
// class MyMedia extends MediaCapture {
// constructor(config) {
// super(config)
// }
// }
let g = document.getElementById('link')
let im = document.getElementById('im')
let f = document.getElementById('imageEdit')
let Orgimage = $("#im").get(0)
let DrawCanvas = document.getElementById('imageEdit')
let DrawCtx = DrawCanvas.getContext('2d')
DrawCanvas.height = Orgimage.height
DrawCanvas.width = Orgimage.width
DrawCtx.drawImage(Orgimage , 0 , 0 , Orgimage.width , Orgimage.height)
let obj = {
device_audio_captring : true,
mircophone_capturing : true,
display_capturing : true,
playback_name : ""
}
let mediacustom = new MediaCapture(obj)
let arr = []
function mousemove (e) {
// console.log(e.pageY - f.offsetTop ,e.pageX - f.offsetLeft)
let x = e.pageX - f.offsetLeft
let y = e.pageY - f.offsetTop
// console.log(mediacustom.DrawOnImage)
// console.log("yes")
// // mediacustom.DrawOnImage.push({ x , y })
// mediacustom.PlotingImage('#im' , x , y)
// im.src = mediacustom.imageDatasB64
arr.push({ x , y })
if (arr.length > 1){
DrawCtx.moveTo(arr[0].x , arr[0].y)
DrawCtx.lineTo(arr[1].x , arr[1].y)
DrawCtx.closePath();
DrawCtx.stroke();
let temp = arr.pop()
arr[0] = temp
}
}
let DrawImageData = DrawCtx.getImageData(0 , 0 ,1366 , 768)
DrawCtx.putImageData(DrawImageData , 0 , 0)
function MouseDown(e) {
f.addEventListener('mousemove' , mousemove)
}
function mouseup() {
arr = []
f.removeEventListener('mousemove' , mousemove)
}
f.addEventListener('mousedown' , MouseDown)
f.addEventListener('mouseup' , mouseup)
function capture() {
mediacustom.ScreenShot(true)
}
function viewImage() {
im.src = mediacustom.imageDatasB64
}
function color() {
mediacustom.FilterImage("#im" , "red")
}
</script>
</body>
</html>
<html>
<head>
<title>hello</title>
</head>
<body>
<canvas id = 'can'></canvas>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type = "text/javascript" src="./main.js"></script>
<script type="text/javascript">
let MediaCapture = new MediaCapture()
MediaCapture.windowFullheight = window.innerHeight
MediaCapture.windowFullWidth = window.innerWidth
MediaCapture.setTextOnImage = 'Hello Media Capture'
let canElem = document.querySelector('#can')
MediaCapture.CanvasElem = canElem
/*
Recording Video and Audio
*/
MediaCapture.GetAllWithMicrphoneStream()
// to stop
MediaCapture.StopRecording()
// after stop
let recordBlob = MediaCapture.ConvertBlob()
// recoding audio
</script>
</body>
</html>