|
|
@ -21,17 +21,13 @@
|
|
|
|
<input type="hidden" name="longitude" value="{{ longitude }}" />
|
|
|
|
<input type="hidden" name="longitude" value="{{ longitude }}" />
|
|
|
|
<input type="hidden" name="latitude" value="{{ latitude }}" />
|
|
|
|
<input type="hidden" name="latitude" value="{{ latitude }}" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="audio">
|
|
|
|
<div id="audio">
|
|
|
|
<div class="record_controls">
|
|
|
|
<div class="record_controls">
|
|
|
|
<a class="record_btn audio_btn" id="record_btn" onclick="record_audio()" href="#"><span class="icon"></span>record</a>
|
|
|
|
<a class="record_btn audio_btn" id="record_btn" onclick="record_audio()" href="#"><span class="icon"></span>record</a>
|
|
|
|
<a class="stop_btn audio_btn" id="stop_btn" onclick="stop_audio()" href="#"><span class="icon"></span>stop</a>
|
|
|
|
<a class="stop_btn audio_btn" id="stop_btn" onclick="stop_audio()" href="#"><span class="icon"></span>stop</a>
|
|
|
|
<a class="play_btn audio_btn" id="play_btn" onclick="play_audio()" href="#"><span class="progress_bar"></span><span class="icon_p"></span>play</a>
|
|
|
|
<a class="play_btn audio_btn" id="play_btn" onclick="play_audio()" href="#"><span class="progress_bar"></span><span class="icon_p"></span>play</a>
|
|
|
|
<a class="redo_btn audio_btn" id="redo_btn" onclick="redo_audio()" href="#"></span>redo</a>
|
|
|
|
<a class="redo_btn audio_btn" id="redo_btn" onclick="redo_audio()" href="#"></span>redo</a>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="audio-player-container"></div>
|
|
|
|
|
|
|
|
<ul id="playlist"></ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<input hidden="true" type="file" name="file" id="uploadedFile" accept="audio/*"><br>
|
|
|
|
<input hidden="true" type="file" name="file" id="uploadedFile" accept="audio/*"><br>
|
|
|
@ -41,9 +37,6 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<button type="submit">Submit</button>
|
|
|
|
<button type="submit">Submit</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
<clear>
|
|
|
|
<clear>
|
|
|
@ -67,33 +60,6 @@ const audioChunks = [];
|
|
|
|
|
|
|
|
|
|
|
|
function record_audio(){
|
|
|
|
function record_audio(){
|
|
|
|
if(state == "empty"){
|
|
|
|
if(state == "empty"){
|
|
|
|
// navigator.mediaDevices.getUserMedia({ audio: true })
|
|
|
|
|
|
|
|
// .then(stream => {
|
|
|
|
|
|
|
|
// mediaRecorder = new MediaRecorder(stream, {mimeType: 'audio/webm;codecs=opus'}); // , {mimeType:"audio/ogg"}
|
|
|
|
|
|
|
|
// mediaRecorder.start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// state = "recording";
|
|
|
|
|
|
|
|
// document.getElementById('stop_btn').style.display = 'block'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// seconds_int = setInterval(
|
|
|
|
|
|
|
|
// function () {
|
|
|
|
|
|
|
|
// document.getElementById("record_btn").innerHTML = seconds_rec + " s";
|
|
|
|
|
|
|
|
// seconds_rec += 1;
|
|
|
|
|
|
|
|
// }, 1000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// mediaRecorder.addEventListener("dataavailable", event => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// audioChunks.push(event.data);
|
|
|
|
|
|
|
|
// if(mediaRecorder.state == 'inactive') makeLink();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
// stop_audio()
|
|
|
|
|
|
|
|
// }, 1000 * 60);
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
recorder.start().then(() => {
|
|
|
|
recorder.start().then(() => {
|
|
|
|
|
|
|
|
|
|
|
|
state = "recording";
|
|
|
|
state = "recording";
|
|
|
@ -169,10 +135,6 @@ function stop_audio(){
|
|
|
|
|
|
|
|
|
|
|
|
const li = document.createElement('li');
|
|
|
|
const li = document.createElement('li');
|
|
|
|
var audioUrl = URL.createObjectURL(file)
|
|
|
|
var audioUrl = URL.createObjectURL(file)
|
|
|
|
// const player = new Audio(audioUrl);
|
|
|
|
|
|
|
|
// player.controls = true;
|
|
|
|
|
|
|
|
// li.appendChild(player);
|
|
|
|
|
|
|
|
// document.querySelector('#playlist').appendChild(li);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let container = new DataTransfer();
|
|
|
|
let container = new DataTransfer();
|
|
|
|
container.items.add(file);
|
|
|
|
container.items.add(file);
|
|
|
@ -222,9 +184,6 @@ function play_audio(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
{% endblock js%}
|
|
|
|
{% endblock js%}
|
|
|
|