android player

smoother

basic caching

prep cache

somewhat works

backup

other files

android impl

blegh

lets go

touchup

add prefetch to js

use caching
This commit is contained in:
Hailey
2024-04-18 03:25:24 -07:00
parent 4cb5f8a005
commit faae20939e
13 changed files with 443 additions and 99 deletions
@@ -4,12 +4,9 @@ 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)
AsyncFunction("prefetchAsync") { (source: String, promise: Promise) in
PlayerItemManager.shared.saveToCache(source: source)
promise.resolve()
}
View(ExpoBlueskyVideoPlayerView.self) {
@@ -19,16 +16,27 @@ public class ExpoBlueskyVideoPlayerModule: Module {
view.source = prop
}
Prop("autoplay") { (view: ExpoBlueskyVideoPlayerView, prop: Bool) in
view.autoplay = prop
}
AsyncFunction("getIsPlayingAsync") { (view: ExpoBlueskyVideoPlayerView, promise: Promise) in
promise.resolve(view.isPlaying)
}
AsyncFunction("playAsync") { (view: ExpoBlueskyVideoPlayerView) in
view.play()
AsyncFunction("toggleAsync") { (view: ExpoBlueskyVideoPlayerView, promise: Promise) in
view.toggle()
promise.resolve()
}
AsyncFunction("pauseAsync") { (view: ExpoBlueskyVideoPlayerView) in
AsyncFunction("playAsync") { (view: ExpoBlueskyVideoPlayerView, promise: Promise) in
view.play()
promise.resolve()
}
AsyncFunction("pauseAsync") { (view: ExpoBlueskyVideoPlayerView, promise: Promise) in
view.pause()
promise.resolve()
}
}
}