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,22 @@
import "pkg:/source/utils/General.bs"
class RingBuffer
private array
private size
private index
function new(size as integer)
m.array = CreateObject("roArray", size, false)
m.size = size
m.index = 0
end function
function Push(tvalue As Dynamic)
m.array[m.index] = tvalue
m.index = (m.index + 1) MOD m.size
end function
function Contains(tvalue As Dynamic) as boolean
return ArrayIndexOf(m.array, tvalue) <> -1
end function
end class