-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
addpath.js
118 lines (68 loc) · 2.73 KB
/
addpath.js
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
function addpath1(){
rectx = "null"
rectwidth = "null"
clearInterval(intervalid);
clearInterval(intervalid12);
clearInterval(videointerval)
var start = parseFloat(document.getElementById("start").value);
var end = parseFloat(document.getElementById("end").value);
time=0;
if(source){
source.stop();
}
if(source1){
source1.stop();
}
document.getElementById("timer").innerHTML = time;
if (check === null ){
document.getElementById("error").innerHTML = "Please select a file"
}
else if (bufferarray===null){
document.getElementById("error").innerHTML = "No data available"
}
else if (isNaN(start)){
document.getElementById("error").innerHTML = "Starting point is not a number"
}
else if (start >= source.buffer.duration){
document.getElementById("error").innerHTML = "starting point is greater than or equal to source buffer duration"
}
else if (start < 0 )
{
document.getElementById("error").innerHTML = "Starting Point must be greater than 0"
}
else if (start >= end) {
document.getElementById("error").innerHTML = "Starting Point must be less than Ending Point"
}
else if (isNaN(end)){
document.getElementById("error").innerHTML = "Ending Point is not a number"
}
else if ( end > source.buffer.duration ){
document.getElementById("error").innerHTML = "Ending point is greater than duration"
end < 0 }
else if ( end <= start){
document.getElementById("error").innerHTML = "Ending Point is greater than equal to Starting Point"
}
else{
var circle =new fabric.Path('M121.32,0L44.58,0C36.67,0,29.5,3.22,24.31,8.41\
c-5.19,5.19-8.41,12.37-8.41,20.28c0,15.82,12.87,28.69,28.69,28.69c0,0,4.4,\
0,7.48,0C36.66,72.78,8.4,101.04,8.4,101.04C2.98,106.45,0,113.66,0,121.32\
c0,7.66,2.98,14.87,8.4,20.29l0,0c5.42,5.42,12.62,8.4,20.28,8.4c7.66,0,14.87\
-2.98,20.29-8.4c0,0,28.26-28.25,43.66-43.66c0,3.08,0,7.48,0,7.48c0,15.82,\
12.87,28.69,28.69,28.69c7.66,0,14.87-2.99,20.29-8.4c5.42-5.42,8.4-12.62,8.4\
-20.28l0-76.74c0-7.66-2.98-14.87-8.4-20.29C136.19,2.98,128.98,0,121.32,0z');
circle.set({ left: 120, top: 120 });
circle.framestart = start
circle.frameend = end
circle.animation = false;
circle.type = "Path"
circle.animationarray = []
circle.id = drawingid
drawingid++;
circle.on("mousedown", function(options){
selectedid = options.target.id
})
drawing.push(circle);
remove();
canvas22.add(drawing[drawing.length-1])
}
}