Skip to content

Commit

Permalink
Added autoplay if user is in "the flow"
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu committed Nov 13, 2020
1 parent 211d66c commit 01c8c50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/SpotifyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ public function saveExploration(Request $request)
]);

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

return back();
return back()->with('autoplay', '1');
}

}
2 changes: 1 addition & 1 deletion resources/views/spotify/explore/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@endisset

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

0 comments on commit 01c8c50

Please sign in to comment.