Skip to content

Commit

Permalink
Add plyr support for podcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
portableant committed Apr 13, 2022
1 parent fef1a53 commit 1cd02c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion public/js/plyr-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var controls =
'settings', // Settings menu
'download', // Show a download button with a link to either the current source or a custom URL you specify in your options
];
const player = new Plyr('.player', { controls });
const player = new Plyr('#player', { controls });

// Expose player so it can be used from the console
window.player = player;
8 changes: 8 additions & 0 deletions resources/views/podcasts/episode.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,11 @@ class="stretched-link">{{ $record['title'][0] }}</a>
</div>
@endsection
@endif

@section('plyr-css')
<link href="https://cdnjs.cloudflare.com/ajax/libs/plyr/3.5.6/plyr.css" rel="stylesheet" media="screen">
@endsection
@section('plyr-js')
<script src="https://cdnjs.cloudflare.com/ajax/libs/plyr/3.5.10/plyr.min.js"></script>
<script defer type="text/javascript" src="/js/plyr-controls.js"></script>
@endsection

0 comments on commit 1cd02c8

Please sign in to comment.