-
Notifications
You must be signed in to change notification settings - Fork 22
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 #399 from THEOplayer/release/v8.2.0
Release/v8.2.0
- Loading branch information
Showing
11 changed files
with
110 additions
and
8 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
28 changes: 28 additions & 0 deletions
28
android/src/main/java/com/theoplayer/playback/PlaybackSettingsModule.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,28 @@ | ||
package com.theoplayer.playback | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule | ||
import com.facebook.react.bridge.ReactMethod | ||
import com.theoplayer.android.api.THEOplayerGlobal | ||
import com.theoplayer.android.api.settings.PlaybackSettings | ||
|
||
class PlaybackSettingsModule(private val context: ReactApplicationContext) : | ||
ReactContextBaseJavaModule(context) { | ||
|
||
private val playbackSettings: PlaybackSettings | ||
get() = THEOplayerGlobal.getSharedInstance(context.applicationContext).playbackSettings | ||
|
||
override fun getName(): String { | ||
return "THEORCTPlaybackSettingsModule" | ||
} | ||
|
||
@ReactMethod | ||
fun useFastStartup(useFastStartup: Boolean) { | ||
playbackSettings.useFastStartup(useFastStartup) | ||
} | ||
|
||
@ReactMethod | ||
fun setLipSyncCorrection(correctionMs: Double) { | ||
playbackSettings.setLipSyncCorrection(correctionMs.toLong()) | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* The playback settings for all instances of THEOplayer. | ||
*/ | ||
export interface PlaybackSettingsAPI { | ||
|
||
/** | ||
* The player starts the playback as soon as the first video data is available related to the initial playback position. | ||
* | ||
* <ul> | ||
* <li>Using this feature will sacrifice the accuracy of the initial seek position | ||
* <li>This API is in an experimental stage and may be subject to breaking changes. | ||
* </ul> | ||
* | ||
* @experimental | ||
* @param {boolean} useFastStartup Whether fast startup is enabled. | ||
* | ||
* @remarks | ||
* - This API is experimental. | ||
* - This property is supported on Android platforms only. | ||
*/ | ||
useFastStartup(useFastStartup: boolean): void; | ||
|
||
/** | ||
* Sets the lip sync correction delay. | ||
* | ||
* This method adjusts the synchronization between audio and video playback for all instances of THEOplayer | ||
* by applying a specified correction delay. | ||
* | ||
* @experimental | ||
* @since Native THEOplayer SDK v8.1.0. | ||
* @param {number} correctionMs The correction delay in milliseconds. | ||
* Positive values advance the audio, while negative values delay it. | ||
* | ||
* @remarks | ||
* - This API is experimental. | ||
* - This property is supported on Android platforms only. | ||
*/ | ||
setLipSyncCorrection(correctionMs: number): void; | ||
} |
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 @@ | ||
export * from './PlaybackSettingsAPI'; |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { NativeModules, Platform } from 'react-native'; | ||
import { PlaybackSettingsAPI } from '../../api/playback/PlaybackSettingsAPI'; | ||
|
||
const NativePlaybackSettingsModule = NativeModules.THEORCTPlaybackSettingsModule; | ||
|
||
const TAG = 'PlaybackSettings'; | ||
|
||
export class NativePlaybackSettings implements PlaybackSettingsAPI { | ||
useFastStartup(useFastStartup: boolean): void { | ||
if (Platform.OS !== 'android') { | ||
console.warn(TAG, 'useFastStartup is only available on Android platforms.'); | ||
return; | ||
} | ||
NativePlaybackSettingsModule.useFastStartup(useFastStartup); | ||
} | ||
setLipSyncCorrection(correctionMs: number): void { | ||
if (Platform.OS !== 'android') { | ||
console.warn(TAG, 'setLipSyncCorrect is only available on Android platforms.'); | ||
return; | ||
} | ||
NativePlaybackSettingsModule.setLipSyncCorrection(correctionMs); | ||
} | ||
} | ||
|
||
export const PlaybackSettings: PlaybackSettingsAPI = new NativePlaybackSettings(); |