Adding JavaScript for enabling file sharing
First, we add a new global variable that is used to hold all the data that defines the list of files that have been shared.
var file_store = []; // shared file storage
Then, at the end of the start()
function, we add an if/else
block, which detects if our browser supports all of the capabilities required to enable file sharing.
// setup file sharing if (!(window.File && window.FileReader && window.FileList && window.Blob)) { document.getElementById("file_sharing").style.display = "none"; alert("This browser does not support File Sharing"); } else { document.getElementById("file_add").onclick = click_file_input; document.getElementById("file_input").addEventListener("change",file_input, false); document.getElementById("open_call_state").addEventListener("dragover", drag_over, false); document.getElementById("open_call_state").addEventListener("drop", file_input, false); ...