Fix Issue where auto-play keeps playing the same videos in a loop

This commit is contained in:
Brahim Hadriche committed 2023-02-03 13:14:24 -05:00
1 parent ae37623756
commit 757bd50701
6 files changed
+74 -5

No files matched your search

@@ -0,0 +1,20 @@
import "pkg:/source/utils/RingBuffer.bs"
function Init()
m.watchedVideos = new RingBuffer(100)
end function
function watchedVideosContain(videoId as string) as boolean
return m.watchedVideos.Contains(videoId)
end function
function watchedVideosAdd(videoId as string)
if not watchedVideosContain(videoId)
m.watchedVideos.Push(videoId)
end if
end function
' watchedVideosClear needs at least one arg https://github.com/rokucommunity/brighterscript/blob/master/docs/callfunc-operator.md#callfunc-evaluation-with-no-arguments
function watchedVideosClear(unused as dynamic)
m.watchedVideos = new RingBuffer(100)
end function