diff --git a/VANA-php/resources/css/app.css b/VANA-php/resources/css/app.css index 76c5bbf..9401612 100644 --- a/VANA-php/resources/css/app.css +++ b/VANA-php/resources/css/app.css @@ -187,6 +187,9 @@ input[type="radio"] + label:hover { margin-right: 1em; } +.vjs-title-bar{ + display: none !important; +} /* Layout */ @@ -218,6 +221,13 @@ main { height: 2em; margin-left: 20em; background: #aaa; + display: flex; + justify-content: space-between; +} + +#timeline-bar>span{ + display: inline-flex; + align-items: center; } #timeline-bar-ctrl{ diff --git a/VANA-php/resources/js/app.js b/VANA-php/resources/js/app.js index 63e0a9f..b69b974 100644 --- a/VANA-php/resources/js/app.js +++ b/VANA-php/resources/js/app.js @@ -132,15 +132,12 @@ const timelineIndicator = document.getElementById('timeline-bar-ctrl'); - // Play / Pause video video.addEventListener('click', _ => { player.paused() ? player.play() : player.pause(); + timelineTimelabels(); }) - - - // Transcript const transcript = document.getElementById('transcript'); const transcript_cues = transcript.querySelectorAll('[data-start]'); @@ -148,6 +145,7 @@ const transcript_cues = transcript.querySelectorAll('[data-start]'); transcript_cues.forEach(c => { c.addEventListener('click', (e) => { player.currentTime(e.target.getAttribute('data-start')); + player.play(); }); }); @@ -160,6 +158,25 @@ const status = { timelineIndicatorIsDragged: false } +function timelineTimelabels(){ + let duration = player.duration() + let step = duration / 10; + let html = '00:00:00' + + for(let i = 1; i <= 10; i++){ + html += `${secondsToTimecode(i * step)}`; + } + + document.querySelector('#timeline-bar').insertAdjacentHTML('beforeend', html); + + console.log(html) + + + +} + + + /** * calcCurrenttimeByPosition * Calculate time to seek to, based on the position of the timelineIndicator. diff --git a/VANA-php/resources/views/detail.blade.php b/VANA-php/resources/views/detail.blade.php index 0b6ce64..1974f69 100644 --- a/VANA-php/resources/views/detail.blade.php +++ b/VANA-php/resources/views/detail.blade.php @@ -54,13 +54,7 @@ @foreach($subtitles['cues'] as $cue)
  • - - {{ $cue['start']}} - - — - - {{ $cue['end']}} - + {{ gmdate('H:i:s', $cue['start'])}}
    {!! $cue['text'] !!} @@ -74,24 +68,7 @@

    Begriffe (Tabinhalt)

    -

    - Some info about terms -

    -

    - Bla bla bla... all about terms... -

    -

    - A beautiful terms -

    -

    - A link to a page with more infos about terms! -

    -

    - More elements can come here related to terms -

    -

    - Maybe even some form element where you can enter a name for your terms: -

    +
    @@ -99,6 +76,9 @@
    + @for($i = 0; $i <= 10; $i++) + {{ gmdate('H:i:s', $i * $durationSteps) }} + @endfor
    diff --git a/VANA-php/routes/web.php b/VANA-php/routes/web.php index b0a0093..880a5e9 100644 --- a/VANA-php/routes/web.php +++ b/VANA-php/routes/web.php @@ -2,6 +2,7 @@ use App\Models\Episode as EpisodeModel; use App\Subtitles as AppSubtitles; +use App\Helpers; use Illuminate\Support\Facades\Route; use Wikidata\Wikidata; use Podlove\Webvtt\Parser; @@ -23,11 +24,12 @@ Route::get('/detail/{id}', function(int $id) { $title = $ep->title; $subtitles = $ep->subtitles; $mediacomposition = json_decode($ep->mediacomposition, 1); + $durationSteps = $mediacomposition['chapterList'][0]['duration'] / 1000 / 10; $parser = new Podlove\Webvtt\Parser(); $subtitles = $parser->parse($subtitles); //dump($subtitles); - return view('detail', ['title' => $title, 'subtitles' => $subtitles, 'mediacomposition' => $mediacomposition]); + return view('detail', ['title' => $title, 'subtitles' => $subtitles, 'mediacomposition' => $mediacomposition, 'durationSteps' => $durationSteps]); }); diff --git a/database.sqlite b/database.sqlite new file mode 100644 index 0000000..ebf03b0 Binary files /dev/null and b/database.sqlite differ