Skip to content

Commit

Permalink
change: truncate the title of video if long
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonortegajr committed May 30, 2024
1 parent eef9245 commit 7c676d6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions public/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ document.getElementById('converter-form').addEventListener('submit', async funct

if (response.ok) {
document.getElementById('thumbnail').src = data.thumbnail;
document.getElementById('title').innerText = `Title: ${data.title}`;
//document.getElementById('title').innerText = `Title: ${data.title}`;
document.getElementById('title').innerText = `Title: ${data.title.length > 5 ? data.title.substring(0, 5) + '...' : data.title}`;
document.getElementById('length').innerText = `Length: ${formatDuration(data.length)}`;
document.getElementById('video-info').style.display = 'block';

Expand Down Expand Up @@ -179,10 +180,5 @@ function formatDuration(seconds) {

/* button onclick call endpoints */
function convert(serviceName) {
// Call your endpoint here
window.location.href = '/tubetogo';
}
function tools(serviceName) {
// Call your endpoint here
window.location.href = '/';
}

0 comments on commit 7c676d6

Please sign in to comment.