forked from valtech-sd/react-native-video
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main-oss' into feature/sync
- Loading branch information
Showing
39 changed files
with
2,327 additions
and
1,350 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,4 @@ var styles = StyleSheet.create({ | |
right: 0, | ||
}, | ||
}); | ||
``` | ||
``` |
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
21 changes: 21 additions & 0 deletions
21
android/src/main/java/com/brentvatne/common/api/ControlsConfig.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,21 @@ | ||
package com.brentvatne.common.api | ||
|
||
import com.brentvatne.common.toolbox.ReactBridgeUtils | ||
import com.facebook.react.bridge.ReadableMap | ||
|
||
class ControlsConfig { | ||
var hideSeekBar: Boolean = false | ||
|
||
companion object { | ||
@JvmStatic | ||
fun parse(src: ReadableMap?): ControlsConfig { | ||
val config = ControlsConfig() | ||
|
||
if (src != null) { | ||
config.hideSeekBar = ReactBridgeUtils.safeGetBool(src, "hideSeekBar", false) | ||
} | ||
|
||
return config | ||
} | ||
} | ||
} |
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
36 changes: 36 additions & 0 deletions
36
android/src/main/java/com/brentvatne/exoplayer/ConfigurationUtils.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,36 @@ | ||
package com.brentvatne.exoplayer | ||
|
||
import androidx.media3.common.MediaItem.LiveConfiguration | ||
import com.brentvatne.common.api.BufferConfig | ||
import com.brentvatne.common.api.BufferConfig.Live | ||
|
||
/** | ||
* Helper functions to create exoplayer configuration | ||
*/ | ||
object ConfigurationUtils { | ||
|
||
/** | ||
* Create a media3.LiveConfiguration.Builder from parsed BufferConfig | ||
*/ | ||
@JvmStatic | ||
fun getLiveConfiguration(bufferConfig: BufferConfig): LiveConfiguration.Builder { | ||
val liveConfiguration = LiveConfiguration.Builder() | ||
val live: Live = bufferConfig.live | ||
if (bufferConfig.live.maxOffsetMs >= 0) { | ||
liveConfiguration.setMaxOffsetMs(live.maxOffsetMs) | ||
} | ||
if (bufferConfig.live.maxPlaybackSpeed >= 0) { | ||
liveConfiguration.setMaxPlaybackSpeed(live.maxPlaybackSpeed) | ||
} | ||
if (bufferConfig.live.targetOffsetMs >= 0) { | ||
liveConfiguration.setTargetOffsetMs(live.targetOffsetMs) | ||
} | ||
if (bufferConfig.live.minOffsetMs >= 0) { | ||
liveConfiguration.setMinOffsetMs(live.minOffsetMs) | ||
} | ||
if (bufferConfig.live.minPlaybackSpeed >= 0) { | ||
liveConfiguration.setMinPlaybackSpeed(live.minPlaybackSpeed) | ||
} | ||
return liveConfiguration | ||
} | ||
} |
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
Oops, something went wrong.