-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-firebase.js
42 lines (37 loc) · 1.29 KB
/
init-firebase.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
var firebaseConfig = {
apiKey: "AIzaSyB2PsbtUCHr2PeP1GVbN9rp0BJE0YxKSdc",
authDomain: "fogaze-utility.firebaseapp.com",
databaseURL: "https://fogaze-utility.firebaseio.com",
projectId: "fogaze-utility",
storageBucket: "fogaze-utility.appspot.com",
messagingSenderId: "91425470876",
appId: "1:91425470876:web:b63a244256e87693dd7059",
measurementId: "G-XF3YEJJP7X"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
var database = firebase.database();
var db = firebase.firestore();
var start=document.querySelector('#start');
if(start){
start.onclick = function start() {
firebase.database().ref('/').update({start:"Y"}, function (error) {
if (error) {
console.log("The write failed...");
} else {
console.log("VIdeo Playing:True")
}
});
}
var stop=document.querySelector('#stop');
stop.onclick = function stop() {
firebase.database().ref('/').update({start:"N"}, function (error) {
if (error) {
console.log("The write failed...");
} else {
console.log("Video playing:False")
}
});
}
}