- findPreviousPlaylistVideo (position = this.currentPlaylistPosition): VideoPlaylistElement {
- if (this.currentPlaylistPosition <= 1) {
- // we have reached the top of the playlist: either loop or stop
- if (this.loopPlaylist) {
- this.currentPlaylistPosition = position = this.playlistPagination.totalItems
- } else {
- return
- }
- }
- const previous = this.playlistElements.find(e => e.position === position)
-
- if (!previous || !previous.video) {
- return this.findPreviousPlaylistVideo(position - 1)
- }
-
- return previous
- }
-