QueueNext/Prev android, ios, flutter
This commit is contained in:
parent
75303691fb
commit
adfe7274fa
3 changed files with 30 additions and 0 deletions
|
|
@ -350,6 +350,16 @@ class FlutterCastFrameworkPlugin : FlutterPlugin, MethodCallHandler, ActivityAwa
|
|||
remoteMediaClient.queueAppendItem(mediaQueueItem, null)
|
||||
}
|
||||
|
||||
override fun queueNextItem() {
|
||||
val remoteMediaClient: RemoteMediaClient = remoteMediaClient ?: return
|
||||
remoteMediaClient.queueNext(null)
|
||||
}
|
||||
|
||||
override fun queuePrevItem() {
|
||||
val remoteMediaClient: RemoteMediaClient = remoteMediaClient ?: return
|
||||
remoteMediaClient.queuePrev(null)
|
||||
}
|
||||
|
||||
override fun setMute(muted: Boolean?) {
|
||||
if (muted == null) return
|
||||
val castSession = mCastSession ?: return
|
||||
|
|
|
|||
|
|
@ -339,6 +339,16 @@ public class SwiftFlutterCastFrameworkPlugin: NSObject, FlutterPlugin, GCKSessio
|
|||
remoteMediaClient?.queueInsert(mediaQueueItem, beforeItemWithID: kGCKMediaQueueInvalidItemID)
|
||||
}
|
||||
|
||||
public func queueNextItemWithError(_ error: AutoreleasingUnsafeMutablePointer<FlutterError?>) {
|
||||
let remoteMediaClient = castSession?.remoteMediaClient
|
||||
remoteMediaClient?.queueNextItem()
|
||||
}
|
||||
|
||||
public func queuePrevItemWithError(_ error: AutoreleasingUnsafeMutablePointer<FlutterError?>) {
|
||||
let remoteMediaClient = castSession?.remoteMediaClient
|
||||
remoteMediaClient?.queuePreviousItem()
|
||||
}
|
||||
|
||||
// MARK: - GCKSessionManagerListener
|
||||
|
||||
// onSessionSuspended
|
||||
|
|
|
|||
|
|
@ -114,6 +114,16 @@ class RemoteMediaClient {
|
|||
_hostApi.queueAppendItem(item);
|
||||
}
|
||||
|
||||
/// Jumps to the next item in the queue.
|
||||
void queueNext() {
|
||||
_hostApi.queueNextItem();
|
||||
}
|
||||
|
||||
/// Jumps to the previous item in the queue.
|
||||
void queuePrev() {
|
||||
_hostApi.queuePrevItem();
|
||||
}
|
||||
|
||||
/// Internal method that shouldn't be visible
|
||||
@internal
|
||||
void dispatchPlayerStateUpdate(PlayerState playerState) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue