Skip to content

Commit 61e8bc7

Browse files
committed
Added demo video
1 parent 987f543 commit 61e8bc7

3 files changed

Lines changed: 24 additions & 15 deletions

File tree

landing/index.html

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,14 @@ <h1>Generate video thumbnail<br />sprite sheets from a URL.</h1>
5555
<h2 class="section-title">See it in action</h2>
5656
<p class="section-sub">Submit a URL, wait for processing, scrub through the result.</p>
5757
<div class="demo-video-wrap">
58-
<video
58+
<iframe
5959
class="demo-video"
60-
src="assets/demo.mp4"
61-
autoplay
62-
loop
63-
muted
64-
playsinline
65-
poster="assets/demo-poster.jpg"
66-
>
67-
Your browser doesn't support HTML5 video.
68-
</video>
60+
src="https://www.youtube.com/embed/kSjOFD-NW8I"
61+
title="Sprite demo"
62+
frameborder="0"
63+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
64+
allowfullscreen
65+
></iframe>
6966
</div>
7067
</div>
7168
</section>
@@ -87,7 +84,7 @@ <h2>Why I built this</h2>
8784
It's fully open source so you can read every line, self-host it, or just use
8885
the hosted version.
8986
</p>
90-
<p class="why-sig">Ruben</p>
87+
<p class="why-sig">Rafik</p>
9188
</div>
9289
</div>
9390
</section>
@@ -247,7 +244,7 @@ <h2>Self-host it</h2>
247244
<a href="https://github.com/rsargsyan/sprite" target="_blank" rel="noopener noreferrer">GitHub</a>
248245
<a href="mailto:hello@sprite.dev">Contact</a>
249246
</nav>
250-
<span class="footer-copy">Made by <a href="https://github.com/rsargsyan" style="color: var(--text-muted); text-decoration: underline;">Ruben</a></span>
247+
<span class="footer-copy">Made by <a href="https://github.com/rafiksargsyan" style="color: var(--text-muted); text-decoration: underline;">Rafik Sargsyan</a></span>
251248
</div>
252249
</footer>
253250

landing/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,15 @@ a { color: inherit; text-decoration: none; }
221221
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
222222
max-width: 900px;
223223
margin: 0 auto;
224+
position: relative;
225+
aspect-ratio: 16 / 9;
224226
}
225227

226228
.demo-video {
229+
position: absolute;
230+
inset: 0;
227231
width: 100%;
232+
height: 100%;
228233
display: block;
229234
}
230235

services/main-ctx/src/main/java/com/rsargsyan/sprite/main_ctx/core/app/ThumbnailsGenerationJobService.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ public void retryStuckJobs() {
200200
job.fail(FailureReason.UNKNOWN);
201201
} else {
202202
log.warn("[{}] Retrying stuck job (attempt {})", job.getStrId(), job.getRetryCount() + 1);
203+
Process stuckProcess = activeProcesses.remove(job.getId());
204+
if (stuckProcess != null) stuckProcess.destroyForcibly();
203205
job.retry();
204206
applicationEventPublisher.publishEvent(new ThumbnailsGenerationJobRetryEvent(job.getId()));
205207
}
@@ -247,6 +249,7 @@ void process(Long jobId) {
247249
Path jobFolder = null;
248250
Path zipFile = null;
249251
final String strId = TSID.from(jobId).toString();
252+
final boolean[] retryScheduled = {false};
250253

251254
try {
252255
var job = transactionTemplate.execute(status -> {
@@ -258,8 +261,9 @@ void process(Long jobId) {
258261
});
259262
if (job == null) return;
260263

261-
jobFolder = Paths.get(config.baseOutputFolder).resolve(strId);
262-
zipFile = Paths.get(config.baseOutputFolder).resolve(strId + ".zip");
264+
String attemptKey = strId + "-" + job.getRetryCount();
265+
jobFolder = Paths.get(config.baseOutputFolder).resolve(attemptKey);
266+
zipFile = Paths.get(config.baseOutputFolder).resolve(attemptKey + ".zip");
263267
List<ThumbnailConfig> configs = job.getJobSpec().configs();
264268
String videoUrl = job.getVideoURL().toString();
265269

@@ -353,7 +357,7 @@ void process(Long jobId) {
353357
log.warn("[{}] {} failed, scheduling retry (attempt {})", strId, reason, j.getRetryCount() + 1);
354358
j.retry();
355359
thumbnailsGenerationJobRepository.save(j);
356-
applicationEventPublisher.publishEvent(new ThumbnailsGenerationJobRetryEvent(j.getId()));
360+
retryScheduled[0] = true;
357361
} else {
358362
j.fail(reason);
359363
thumbnailsGenerationJobRepository.save(j);
@@ -369,6 +373,9 @@ void process(Long jobId) {
369373
if (heartbeat != null) heartbeat.cancel(false);
370374
if (jobFolder != null) deleteRecursively(jobFolder);
371375
try { if (zipFile != null) Files.deleteIfExists(zipFile); } catch (IOException ignored) {}
376+
if (retryScheduled[0]) {
377+
applicationEventPublisher.publishEvent(new ThumbnailsGenerationJobRetryEvent(jobId));
378+
}
372379
}
373380
}
374381

0 commit comments

Comments
 (0)