Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 01c8c50

Browse files
committed
Added autoplay if user is in "the flow"
1 parent 211d66c commit 01c8c50

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/Http/Controllers/SpotifyController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ public function saveExploration(Request $request)
553553
]);
554554

555555
if ($result->getStatusCode() == 200) {
556-
return back()->with('alert-success', 'Der Track wurde in deiner Bibliothek gespeichert! :)');
556+
return back()->with('alert-success', 'Der Track wurde in deiner Bibliothek gespeichert! :)')
557+
->with('autoplay', '1');
557558
}
558559
} catch (GuzzleException $exception) {
559560
report($exception);
@@ -562,7 +563,7 @@ public function saveExploration(Request $request)
562563
}
563564
}
564565

565-
return back();
566+
return back()->with('autoplay', '1');
566567
}
567568

568569
}

resources/views/spotify/explore/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@endisset
3333

3434
@isset($track->preview_url)
35-
<audio controls="">
35+
<audio controls="" @if(Session::has('autoplay')) autoplay @endif>
3636
<source src="{{$track->preview_url}}" type="audio/mpeg">
3737
Your browser does not support the audio element.';
3838
</audio>

0 commit comments

Comments
 (0)