diff --git a/app/Http/Controllers/StreamController.php b/app/Http/Controllers/StreamController.php index 78362399..dfa1a6bc 100644 --- a/app/Http/Controllers/StreamController.php +++ b/app/Http/Controllers/StreamController.php @@ -30,6 +30,17 @@ class StreamController extends Controller return view('watch', ['title' => 'Kijk NH Gooi Tv Studio', 'stream' => 'https://studiocam.nhgooi.nl/studiocam/live/index.m3u8']); } + public function inline(Request $request, $id) + { + $apiResult = $this->API('podcast/details/' . (int)$id); + $podcast = new \Model\Podcast($apiResult); + if(sha1($id . ':' . date('Y-m-d')) != $request->get('auth')) { + // return view('widgets/podcastplayer', ['podcast' => null]); + } + + return view('widgets/podcastplayer', ['podcast' => $podcast]); + } + public function podcast(Request $request, $id) { $apiResult = $this->API('podcast/details/' . (int)$id); diff --git a/public/css/style.css b/public/css/style.css index 73c9b2a1..30cbfa26 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1649,4 +1649,10 @@ a, a:hover, a:active { } } +.podcast-player .content { + border: solid 1px #333; + border-radius: 5px; + padding: 0.4rem; +} + /*# sourceMappingURL=style.css.map */ diff --git a/public/js/main.js b/public/js/main.js index 8b137891..6ea6ddb3 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1 +1,7 @@ - +$(function() { + $('.podcast-player').each(function() { + var id = $(this).data('id'); + var auth = $(this).data('auth'); + $(this).load('/luister/fragment/inline/' + id + '?auth=' + auth); + }); +}); diff --git a/resources/views/layouts/master.blade.php b/resources/views/layouts/master.blade.php index 95c22049..d6f4f9d1 100644 --- a/resources/views/layouts/master.blade.php +++ b/resources/views/layouts/master.blade.php @@ -186,8 +186,8 @@ - --> + diff --git a/resources/views/partial/nh_story.blade.php b/resources/views/partial/nh_story.blade.php index 99e8d39c..d325b421 100644 --- a/resources/views/partial/nh_story.blade.php +++ b/resources/views/partial/nh_story.blade.php @@ -14,6 +14,9 @@ @elseif($block->type == "text")
{!!$block->text!!}
+ @if (preg_match('!/gemist/fragment/([0-9]*)/!', $block->text, $match)) +
+ @endif @elseif($block->type == "intro")

{!!strip_tags($block->text)!!}

@elseif($block->type == "info") diff --git a/routes/web.php b/routes/web.php index 7511274f..994eb2ab 100644 --- a/routes/web.php +++ b/routes/web.php @@ -53,6 +53,7 @@ Route::get('/luister/fragment')->name('luister.podcast'); Route::get('/luister/programma/{year}/{month}/{day}/{hour}/{duration}/{offset?}', 'StreamController@program') ->where(['id' => '\d+', 'year' => '20\d\d', 'month' => '\d\d?', 'day' => '\d\d?', 'hour' => '\d\d?', 'duration' => '\d\d?', 'offset' => '\d\d?']); Route::get('/luister/programma')->name('luister.programma'); +Route::get('/luister/fragment/inline/{id}', 'StreamController@inline')->where(['id' => '\d+']); Route::get('/gemist', 'RadioController@podcasts')->name('gemist'); Route::get('/gemist/zoeken/{query}', 'RadioController@searchpodcast')->name('gemist.zoeken');