ios player

autoplay after recycle

remove all items from AVPlayer queue

recurururururursion

use managers in the view

add prefetch

make sure player items stay in order

add controller and item managers

start of the view

create module, ios
This commit is contained in:
Hailey
2024-04-17 17:59:34 -07:00
parent 7e16276c04
commit 4cb5f8a005
13 changed files with 385 additions and 0 deletions
@@ -0,0 +1,35 @@
import ExpoModulesCore
public class ExpoBlueskyVideoPlayerModule: Module {
public func definition() -> ModuleDefinition {
Name("ExpoBlueskyVideoPlayer")
AsyncFunction("setShouldAutoplayAsync") { (value: Bool) in
}
AsyncFunction("prefetchAsync") { (source: String) in
PlayerItemManager.shared.getOrAddItem(source: source)
}
View(ExpoBlueskyVideoPlayerView.self) {
Events(["onLoad"])
Prop("source") { (view: ExpoBlueskyVideoPlayerView, prop: String) in
view.source = prop
}
AsyncFunction("getIsPlayingAsync") { (view: ExpoBlueskyVideoPlayerView, promise: Promise) in
promise.resolve(view.isPlaying)
}
AsyncFunction("playAsync") { (view: ExpoBlueskyVideoPlayerView) in
view.play()
}
AsyncFunction("pauseAsync") { (view: ExpoBlueskyVideoPlayerView) in
view.pause()
}
}
}
}