import { type ViewProps } from 'react-native'; import { Component } from 'react'; type PlayspacePlayerState = { setPlayspaceConfigCallback: ((errorMessage: string | undefined, success: Boolean | undefined) => void) | undefined; playCallback: ((errorMessage: string) => void) | undefined; pauseCallback: ((errorMessage: string) => void) | undefined; setVolumeCallback: ((errorMessage: string) => void) | undefined; setQualityCallback: ((errorMessage: string) => void) | undefined; getQualityCallback: ((errorMessage: string | undefined, quality: number | undefined) => void) | undefined; disableAdvertisingCallback: ((errorMessage: string) => void) | undefined; enableAdvertisingCallback: ((errorMessage: string) => void) | undefined; setMacrosCallback: ((errorMessage: string) => void) | undefined; setPreRollBreakCallback: ((errorMessage: string) => void) | undefined; setPostRollBreakCallback: ((errorMessage: string) => void) | undefined; addFriendlyObstructionCallback: ((errorMessage: string) => void) | undefined; removeFriendlyObstructionCallback: ((errorMessage: string) => void) | undefined; getStoryPositionCallback: ((errorMessage: string | undefined, position: number | undefined) => void) | undefined; setStoryPositionCallback: ((errorMessage: string) => void) | undefined; getStoryIdCallback: ((errorMessage: string | undefined, storyId: string | undefined) => void) | undefined; getStoryTimelineCallback: ((errorMessage: string | undefined, timeline: number[] | undefined) => void) | undefined; getLayoutCallback: ((errorMessage: string | undefined, layout: number | undefined) => void) | undefined; setLayoutCallback: ((errorMessage: string) => void) | undefined; setCtaLabelCallback: ((errorMessage: string) => void) | undefined; getStoryMetadataCallback: ((errorMessage: string | undefined, storyMetadata: Array> | undefined) => void) | undefined; listenForCallback: ((errorMessage: string) => void) | undefined; listenForMoreCallback: ((errorMessage: string) => void) | undefined; removeCallback: ((errorMessage: string) => void) | undefined; }; type PlayspacePlayerProps = ViewProps & { onPlayerEvent?: ((event: any) => void) | undefined; }; declare class PlayspacePlayer extends Component { constructor(props: PlayspacePlayerProps); /** * Sets the configuration for the Playspace player * @param config JSON string needed for the player to run * @param callback optional callback which returns true on success or error message on failure cases */ setPlayspaceConfig(config: string, callback?: ((errorMessage: string | undefined, success: Boolean | undefined) => void) | undefined): void; private _handleNativeSetPlayspaceConfigCallback; /** * Stops every function of the player, including the ad session. The player will need to be restarted after this */ stopPlayer(): void; /** * Sets the player state to "play" * @param callback optional callback for failure cases */ play(callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativePlayCallback; /** * Sets the player state to "pause" * @param callback optional callback for failure cases */ pause(callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativePauseCallback; /** * Sets the player volume to the specified value * @param volume float between 0 and 1 * @param callback optional callback for failure cases */ setVolume(volume: number, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeSetVolumeCallback; /** * Sets the resolution of the video to the specified quality * @param quality int, only 360, 720 and 1080 supported * @param callback optional callback for failure cases */ setQuality(quality: number, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeSetQualityCallback; /** * Returns the current resolution of the video * @param callback callback for the Int quality on success or the error message on failure */ getQuality(callback: ((errorMessage: string | undefined, quality: number | undefined) => void) | undefined): void; private _handleNativeGetQualityCallback; /** * Pauses player advertising, note that a running ad will finish if this method is called * @param callback optional callback for failure cases */ disableAdvertising(callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeDisableAdvertisingCallback; /** * If advertising was previously disabled by the 'disableAdvertising' call, it will enable it back * @param callback optional callback for failure cases */ enableAdvertising(callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeEnableAdvertisingCallback; /** * Sets custom macros. The method uses key value pairs of macros { key: value }. Please note that Connatix Macros will NOT we overridden * @param macrosJsonString representing key value pairs of macros to be substituted in lineItems URLs before calling for VAST Ads. If any of the macro keys match the "Connatix macros" (ex: height, page_url), the values provided programmatically by the user will NOT override the values detected by the player, only for the externally loaded line items * @param callback optional callback for failure cases */ setMacros(macrosJsonString: string, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeSetMacrosCallback; /** * Dynamically set the pre-roll break duration. This method needs to be called with the duration in seconds. To disable the break call this with 0 value * @param seconds number of seconds for the pre-roll break * @param callback optional callback for failure cases */ setPreRollBreak(seconds: number, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeSetPreRollBreakCallback; /** * Dynamically set the post-roll break duration. This method needs to be called with the duration in seconds. To disable the break call this with 0 value * @param seconds number of seconds for the post-roll break * @param callback optional callback for failure cases */ setPostRollBreak(seconds: number, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeSetPostRollBreakCallback; /** * Adds friendly obstruction which should then be excluded from all ad session viewability calculations. * It also provides a purpose and detailed reason string to pass forward to the measurement vendors. * This method will have no effect if called after the ad session has finished. * @param obstructionReactTag the react tag of the view to be excluded from all ad session viewability calculations * @param purpose the purpose of why this obstruction was necessary. Possible values: "videoControls", "closeAd", "notVisible", "other" * @param detailedReason an explanation for why this obstruction is part of the ad experience if not already obvious from the purpose. Can be null. If not null, must be 50 characters or less and only contain characters `A-z`, `0-9`, or spaces * @param callback optional callback for failure cases */ addFriendlyObstruction(obstructionReactTag: number, purpose: string, detailedReason: string, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeAddFriendlyObstructionCallback; /** * Removes registered friendly obstruction. This method will have no effect if called after the ad session has finished * @param obstructionReactTag the react tag of the view to be removed from the list of registered friendly obstructions * @param callback optional callback for failure cases */ removeFriendlyObstruction(obstructionReactTag: number, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeRemoveFriendlyObstructionCallback; /** * Returns the current slide index. int value starting with 0 from the first slide * @param callback callback for the slidex index on success on the error message on failure */ getStoryPosition(callback: ((errorMessage: string | undefined, position: number | undefined) => void) | undefined): void; private _handleNativeGetStoryPositionCallback; /** * Sets the current slide to the provided index * @param index numeric value starting with 0 from the first slide * @param callback optional callback for failure cases */ setStoryPosition(index: number, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeSetStoryPositionCallback; /** * Returns the ID of the currently playing story * @param callback callback for the story ID on success or the error message on failure */ getStoryId(callback: ((errorMessage: string | undefined, storyId: string | undefined) => void) | undefined): void; private _handleNativeGetStoryIdCallback; /** * Returns an array of int with the durations of all slides. Each item from the list represents the duration in seconds * @param callback callback for the story timeline on success or the error message on failure */ getStoryTimeline(callback: ((errorMessage: string | undefined, timeline: number[] | undefined) => void) | undefined): void; private _handleNativeGetStoryTimelineCallback; /** * Returns an int representing the current story player layout * - 0 is Portrait * - 1 is Landscape * @param callback callback for the int layout on success or the error message on failure */ getLayout(callback: ((errorMessage: string | undefined, layout: number | undefined) => void) | undefined): void; private _handleNativeGetLayoutCallback; /** * Forces the story player to render in chosen orientation mode. Orientation mode will be changed based on the parameter received * - 0 is Portrait * - 1 is Landscape * @param layoutType to change the orientation to * @param callback optional callback for failure cases */ setLayout(layoutType: number, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeSetLayoutCallback; /** * Updates the label of the Call to Action button for the provided slide * @param slideIndex representing the index of the slide which needs to be updated * @param label description for the Call to Action button, maximum 16 characters * @param callback optional callback for failure cases */ setCtaLabel(slideIndex: number, label: string, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeSetCtaLabelCallback; /** * Returns an array containing story metadata from each slide * @param callback callback for the story metadata on success or the error message on failure */ getStoryMetadata(callback: ((errorMessage: string | undefined, storyMetadata: Array> | undefined) => void) | undefined): void; private _handleNativeGetStoryMetadataCallback; /** * Listens to a single player event. Can be done once or as long as the player is alive * @param event the string event type to listen to * @param once boolean indicating whether the event is listened to once or indefinitely * @param callback optional callback for failure cases */ listenFor(event: string, once: boolean, callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeListenForCallback; /** * Listens to a string array of player event * @param events Array of string to listen to indefinitely * @param callback optional callback for failure cases */ listenForMore(events: string[], callback?: ((errorMessage: string) => void) | undefined): void; private _handleNativeListenForMoreCallback; /** * Listens to all available player events. Please check the documentation for all the possible event types */ listenForAllEvents(): void; /** * Removes the listener for the specified player string event type * @param event stop listening for this string event * @param callback optional callback for failure cases */ remove(event: string, callback?: ((errorMessage: string) => void) | undefined): void; /** * Removes the listeners for all player events */ private _handleNativeRemoveCallback; removeAllEvents(): void; private _handleNativeOnPlayerEventCallback; private _dispatchCommand; private _dispatchCommandWithArguments; render(): JSX.Element; } export default PlayspacePlayer; //# sourceMappingURL=PlayspacePlayer.d.ts.map