Skip to content

Commit

Permalink
Merge pull request #335 from bitmovin/release/v0.14.2
Browse files Browse the repository at this point in the history
Release 0.14.2
  • Loading branch information
rolandkakonyi authored Nov 27, 2023
2 parents d84277d + 8f3af88 commit 69989fd
Show file tree
Hide file tree
Showing 13 changed files with 321 additions and 239 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [0.14.2] (2023-11-27)

### Fixed

- Android: `onEvent` callback not being called on `PlayerView`
- iOS: `onEvent` on iOS has incomplete payload information
- tvOS: Picture in Picture sample screen has unwanted padding
- iOS: hide home indicator when entering fullscreen mode in the example application

## [0.14.1] (2023-11-16)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion RNBitmovinPlayer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,mm,swift}"

s.dependency "React-Core"
s.dependency "BitmovinPlayer", "3.48.0"
s.dependency "BitmovinPlayer", "3.49.0"
s.ios.dependency "GoogleAds-IMA-iOS-SDK", "3.18.4"
s.tvos.dependency "GoogleAds-IMA-tvOS-SDK", "4.8.2"
end
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import com.facebook.react.uimanager.events.RCTEventEmitter
import kotlin.reflect.KClass

private val EVENT_CLASS_TO_REACT_NATIVE_NAME_MAPPING = mapOf(
PlayerEvent::class to "event",
PlayerEvent.Error::class to "playerError",
PlayerEvent.Warning::class to "playerWarning",
PlayerEvent.Destroy::class to "destroy",
Expand Down Expand Up @@ -139,7 +138,10 @@ class RNPlayerView(
* Relays the provided set of events, emitted by the player, together with the associated name
* to the `eventOutput` callback.
*/
private val playerEventRelay = EventRelay<Player, Event>(EVENT_CLASS_TO_REACT_NATIVE_NAME_MAPPING, ::emitEvent)
private val playerEventRelay = EventRelay<Player, Event>(
EVENT_CLASS_TO_REACT_NATIVE_NAME_MAPPING,
::emitEventFromPlayer,
)

/**
* Relays the provided set of events, emitted by the player view, together with the associated name
Expand Down Expand Up @@ -318,6 +320,17 @@ class RNPlayerView(
.getJSModule(RCTEventEmitter::class.java)
.receiveEvent(id, name, payload)
}

/**
* Emits a bubbling event from the player with payload to js
* and emits it for "event" to support `onEvent` prop.
* @param name Native event name.
* @param event Optional js object to be sent as payload.
*/
private inline fun <reified E : Event> emitEventFromPlayer(name: String, event: E) {
emitEvent(name, event)
emitEvent("event", event)
}
}

/**
Expand Down
24 changes: 12 additions & 12 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
PODS:
- BitmovinAnalyticsCollector/BitmovinPlayer (3.1.2):
- BitmovinAnalyticsCollector/BitmovinPlayer (3.3.0):
- BitmovinAnalyticsCollector/Core
- BitmovinPlayerCore (~> 3.41)
- BitmovinAnalyticsCollector/Core (3.1.2)
- BitmovinPlayer (3.48.0):
- BitmovinPlayerCore (~> 3.48)
- BitmovinAnalyticsCollector/Core (3.3.0)
- BitmovinPlayer (3.49.0):
- BitmovinAnalyticsCollector/BitmovinPlayer (~> 3.0)
- BitmovinPlayerCore (= 3.48.0)
- BitmovinPlayerCore (3.48.0)
- BitmovinPlayerCore (= 3.49.0)
- BitmovinPlayerCore (3.49.0)
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
Expand Down Expand Up @@ -345,8 +345,8 @@ PODS:
- React-jsi (= 0.69.6-2)
- React-logger (= 0.69.6-2)
- React-perflogger (= 0.69.6-2)
- RNBitmovinPlayer (0.14.1):
- BitmovinPlayer (= 3.48.0)
- RNBitmovinPlayer (0.14.2):
- BitmovinPlayer (= 3.49.0)
- GoogleAds-IMA-iOS-SDK (= 3.18.4)
- GoogleAds-IMA-tvOS-SDK (= 4.8.2)
- React-Core
Expand Down Expand Up @@ -523,9 +523,9 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
BitmovinAnalyticsCollector: 11769c5503a08c8e3495f2e2bdca8f72db6b973f
BitmovinPlayer: 4403bd2187b2e31106b25971fa98c9c4929d46d4
BitmovinPlayerCore: 054684e1a1cc262721c70c5cf3884f1e32b65e0c
BitmovinAnalyticsCollector: b3bf447e609a87d41e51a7c029cb16a3bcb3404c
BitmovinPlayer: 920ee8a7df47dc09a038a44a36b24b0c31427ad8
BitmovinPlayerCore: 0040c6c171079ae1a1342baab182c7956deaf6d8
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 234abba95e31cc2aada0cf3b97cdb11bc5b90575
Expand Down Expand Up @@ -574,7 +574,7 @@ SPEC CHECKSUMS:
React-RCTText: f72442f7436fd8624494963af4906000a5465ce6
React-runtimeexecutor: f1383f6460ea3d66ed122b4defb0b5ba664ee441
ReactCommon: 7857ab475239c5ba044b7ed946ba564f2e7f1626
RNBitmovinPlayer: e2436bccf53ed596ece178e6553ea7268d792163
RNBitmovinPlayer: 020d9bcad225ddee065212cbba660673e456f391
RNCPicker: 0250e95ad170569a96f5b0555cdd5e65b9084dca
RNScreens: 4a1af06327774490d97342c00aee0c2bafb497b7
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Expand Down
1 change: 1 addition & 0 deletions example/src/screens/BasicFullscreenHandling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default function BasicFullscreenHandling({
setFullscreenMode(isFullscreen);
navigation.setOptions({
headerShown: !isFullscreen, // show/hide top bar
autoHideHomeIndicator: isFullscreen, // show/hide home indicator on iOS
});
})
).current;
Expand Down
14 changes: 9 additions & 5 deletions example/src/screens/BasicPictureInPicture.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useState } from 'react';
import { Button, Platform, StyleSheet } from 'react-native';
import { Button, Platform, StyleSheet, View, ViewProps } from 'react-native';
import { useFocusEffect } from '@react-navigation/native';
import {
Event,
Expand Down Expand Up @@ -116,9 +116,9 @@ export default function BasicPictureInPicture({
[]
);

const ContainerView = Platform.isTV ? View : SafeAreaContainer;
return (
<SafeAreaView
edges={['bottom', 'left', 'right']}
<ContainerView
style={
// On Android, we need to remove the padding from the container when in PiP mode.
Platform.OS === 'android' && isInPictureInPicture
Expand All @@ -137,17 +137,21 @@ export default function BasicPictureInPicture({
onPictureInPictureExit={onPictureInPictureExitEvent}
onPictureInPictureExited={onEvent}
/>
</SafeAreaView>
</ContainerView>
);
}

function SafeAreaContainer(props: ViewProps): JSX.Element {
return <SafeAreaView edges={['bottom', 'left', 'right']} {...props} />;
}

const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'white',
padding: 10,
padding: Platform.isTV ? 0 : 10,
},
player: {
flex: 1,
Expand Down
5 changes: 4 additions & 1 deletion example/src/screens/LandscapeFullscreenHandling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export default function LandscapeFullscreenHandling({
new SampleFullscreenHandler(fullscreenMode, (isFullscreen: boolean) => {
console.log('on fullscreen change');
setFullscreenMode(isFullscreen);
navigation.setOptions({ headerShown: !isFullscreen });
navigation.setOptions({
headerShown: !isFullscreen, // show/hide top bar
autoHideHomeIndicator: isFullscreen, // show/hide home indicator on iOS
});
})
).current;
useFocusEffect(
Expand Down
9 changes: 9 additions & 0 deletions ios/DefaultJsonConvertibleEvent.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import BitmovinPlayer

/// Used when the event has no additional data
internal protocol DefaultJsonConvertibleEvent: JsonConvertible {}
internal extension DefaultJsonConvertibleEvent where Self: Event {
func toJSON() -> [AnyHashable: Any] {
toEventJSON { [:] }
}
}
Loading

0 comments on commit 69989fd

Please sign in to comment.