Skip to content

Commit

Permalink
changes in UI and user quality of life
Browse files Browse the repository at this point in the history
  • Loading branch information
MAlshaik committed Apr 13, 2023
1 parent d69c20a commit 1cb20f6
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 28 deletions.
29 changes: 15 additions & 14 deletions Frontend/templates/Frontend/video-editing.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,20 @@

<video id="video" controls>
<source id="source" type="video/mp4">
</video>
</div>
<div id="timeline">
<div id="timeline-controls">
<button id="cut" onclick="cuttingMode()">cut</button>
<button id="start" onclick="startCut()">start</button>
<button id="end" onclick="endCut()">end</button>
</div>
<div id="screenshotContainer">
<div id="bar"></div>
</video>

<div id="timeline">
<div id="timeline-controls">
<button id="cut" onclick="cuttingMode()">cut</button>
<button id="start" onclick="startCut()">start</button>
<button id="end" onclick="endCut()">end</button>
</div>
<div id="screenshotContainer">
<div id="bar"></div>
</div>
</div>
</div>

</div>
<script src="{% static 'js/upload-video.js' %}"></script>
<script src="{% static 'js/transcript-generation.js' %}"></script>
<script src="{% static 'js/transcript-editing.js' %}"></script>
Expand All @@ -95,8 +96,8 @@
document.addEventListener("DOMContentLoaded", function() {
console.log("----------------DOMContentLoaded------------------------")
});
</script>

</script>



</body>
</body>
Binary file not shown.
Binary file modified d23f6b79-19b6-4037-bcb2-eb1188f753b6TEMP_MPY_wvf_snd.mp3
Binary file not shown.
Binary file not shown.
15 changes: 6 additions & 9 deletions static/css/video-editing.css
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,19 @@ nav ul li a{

.transcript-container-wrapper {
width: 30%;
height: 75%;
height: 100%;
display: flex;
flex-direction: column;
padding: 50px;
}

.transcript-container {
width: 100%;
height: 100%;
padding-top: 10px;
margin-left: 3%;
float: left;
font-family: Arial, sans-serif;
padding: 50px;
border: 2px white;
overflow: scroll;
}
Expand Down Expand Up @@ -331,8 +332,7 @@ nav ul li a{
} */

.transcript-controls {
margin-top: 10%;
margin-bottom: 5px;
margin-bottom: 5px;
margin-left: 3%;
text-align: right;
}
Expand Down Expand Up @@ -380,16 +380,13 @@ nav ul li a{
#timeline {
width: 100%;
height: 20%;
padding: 20px 20px 20px 20px;
margin-top: 10px;
margin-top: 20px;
background-color: #454c5a;
border-radius: 5px;
display: flex;
align-items: center;
justify-content: center;
clear: both;
position: absolute;
bottom: 0;

}

#screenshotContainer {
Expand Down
6 changes: 3 additions & 3 deletions static/js/generate-timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ function cuttingMode(){
function startCut(){
console.log(timelineTimestamps["timestamps"]);
timelineTimestamps["timestamps"] = [];
timelineTimestamps["timestamps"].push([video.currentTime.toString()]);
timelineTimestamps["timestamps"].push([video.currentTime]);
}

function endCut(){

timelineTimestamps["timestamps"][0].push(video.currentTime.toString());
console.log(video.currentTime);
timelineTimestamps["timestamps"][0].push(video.currentTime);
cutVideo(id, timelineTimestamps);

cutButton.style.display = "flex";
Expand Down
3 changes: 3 additions & 0 deletions static/js/transcript-generation.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ function load(){
}

function processData(data) {
console.log(`%c Before: ${transcriptArea.innerHTML}`,'color: red');
transcriptArea.innerHTML = "";
console.log(`%c After: ${transcriptArea.innerHTML}`,'color: red');
transcriptHTML = ` `;
line = '';
paragraph = `<p>`;
console.log(data["timestamps"]);
Expand Down
4 changes: 3 additions & 1 deletion static/js/video-editing.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ async function makeRequest(url, data) {
}

async function cutVideo(id, timestamps){
console.trace();
// Given a dictonary containing a timestamp list, cut the video in according to the timestamps.

console.log(timestamps);

let timestampJson = JSON.stringify(timestamps);
let timestampList = timestamps["timestamps"];

Expand Down
1 change: 0 additions & 1 deletion transcription/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ def cut_files(request):
# Iterate over each cut:

for cut in cuts:
cut = [eval(i) for i in cut]
print(f"Current timestamp: {cut}")

clip = clip.cutout(cut[0] - total_removed, cut[1] - total_removed)
Expand Down

0 comments on commit 1cb20f6

Please sign in to comment.