-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #265 from bitmovin/release/v0.12.0
Release 0.12.0
- Loading branch information
Showing
77 changed files
with
1,928 additions
and
1,051 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,6 @@ android.iml | |
# Cocoapods | ||
# | ||
example/ios/Pods/ | ||
example/vendor/bundle/ | ||
|
||
# node.js | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
196 changes: 0 additions & 196 deletions
196
android/src/main/java/com/bitmovin/player/reactnative/AnalyticsModule.kt
This file was deleted.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
android/src/main/java/com/bitmovin/player/reactnative/BitmovinCastManagerModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package com.bitmovin.player.reactnative | ||
|
||
import com.bitmovin.player.casting.BitmovinCastManager | ||
import com.bitmovin.player.reactnative.converter.JsonConverter | ||
import com.facebook.react.bridge.Promise | ||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule | ||
import com.facebook.react.bridge.ReactMethod | ||
import com.facebook.react.bridge.ReadableMap | ||
import com.facebook.react.module.annotations.ReactModule | ||
import com.facebook.react.uimanager.UIManagerModule | ||
|
||
private const val MODULE_NAME = "BitmovinCastManagerModule" | ||
|
||
@ReactModule(name = MODULE_NAME) | ||
class BitmovinCastManagerModule( | ||
private val context: ReactApplicationContext, | ||
) : ReactContextBaseJavaModule(context) { | ||
override fun getName() = MODULE_NAME | ||
|
||
/** | ||
* Returns whether the [BitmovinCastManager] is initialized. | ||
*/ | ||
@ReactMethod | ||
fun isInitialized(promise: Promise) = uiManager?.addUIBlock { | ||
promise.resolve(BitmovinCastManager.isInitialized()) | ||
} | ||
|
||
/** | ||
* Initializes the [BitmovinCastManager] with the given options. | ||
*/ | ||
@ReactMethod | ||
fun initializeCastManager(options: ReadableMap?, promise: Promise) { | ||
val castOptions = JsonConverter.toCastOptions(options) | ||
uiManager?.addUIBlock { | ||
BitmovinCastManager.initialize( | ||
castOptions?.applicationId, | ||
castOptions?.messageNamespace | ||
) | ||
promise.resolve(null) | ||
} | ||
} | ||
|
||
/** | ||
* Sends a message to the receiver. | ||
*/ | ||
@ReactMethod | ||
fun sendMessage(message: String, messageNamespace: String?, promise: Promise) { | ||
uiManager?.addUIBlock { | ||
BitmovinCastManager.getInstance().sendMessage(message, messageNamespace) | ||
promise.resolve(null) | ||
} | ||
} | ||
|
||
/** | ||
* Updates the context of the [BitmovinCastManager] to the current activity. | ||
*/ | ||
@ReactMethod | ||
fun updateContext(promise: Promise) { | ||
uiManager?.addUIBlock { | ||
BitmovinCastManager.getInstance().updateContext(currentActivity) | ||
promise.resolve(null) | ||
} | ||
} | ||
|
||
private val uiManager: UIManagerModule? | ||
get() = context.getNativeModule(UIManagerModule::class.java) | ||
} | ||
|
||
/** | ||
* Represents configuration options for the [BitmovinCastManager]. | ||
*/ | ||
data class BitmovinCastManagerOptions( | ||
val applicationId: String? = null, | ||
val messageNamespace: String? = null, | ||
) |
Oops, something went wrong.