Skip to content

Commit

Permalink
Feat: add secondary constructor P2PMediaLoader for Java compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaDemchenko committed Jan 2, 2025
1 parent 32b9f8c commit eba4f22
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion p2pml/src/main/java/com/novage/p2pml/P2PMediaLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,29 @@ import kotlinx.coroutines.runBlocking
* Default: null (uses built-in implementation)
*/
@UnstableApi
class P2PMediaLoader constructor(
class P2PMediaLoader(
private val readyCallback: P2PReadyCallback,
private val errorCallback: OnErrorCallback,
private val coreConfigJson: String = "",
private val serverPort: Int = Constants.DEFAULT_SERVER_PORT,
private val customJavaScriptInterfaces: List<Pair<String, Any>> = emptyList(),
private val customEngineImplementationPath: String? = null,
) {
// Secondary constructor for Java compatibility
constructor(
readyCallback: P2PReadyCallback,
errorCallback: OnErrorCallback,
serverPort: Int,
coreConfigJson: String,
) : this(
readyCallback,
errorCallback,
coreConfigJson,
serverPort,
emptyList(),
null
)

private val engineStateManager = P2PStateManager()
private val playbackCalculator = ExoPlayerPlaybackCalculator()
private val manifestParser = HlsManifestParser(playbackCalculator, serverPort)
Expand Down

0 comments on commit eba4f22

Please sign in to comment.