diff --git a/CHANGELOG.md b/CHANGELOG.md index 79216273a..35eac1a54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [8.8.1] - 24-11-20 + +### Fixed + +- Fixed build issue on tvOS caused by HomeIndicatorViewController + ## [8.8.0] - 24-11-19 ### Added diff --git a/example/package-lock.json b/example/package-lock.json index 84105f99e..cc5083289 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -5696,9 +5696,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", diff --git a/ios/presentationMode/THEOplayerRCTPresentationModeManager.swift b/ios/presentationMode/THEOplayerRCTPresentationModeManager.swift index 9544c1ca7..4b9471ac5 100644 --- a/ios/presentationMode/THEOplayerRCTPresentationModeManager.swift +++ b/ios/presentationMode/THEOplayerRCTPresentationModeManager.swift @@ -66,21 +66,14 @@ public class THEOplayerRCTPresentationModeManager { self.moveView(containerView, to: fullscreenParentView) // start hiding home indicator - if let customRootViewController = fullscreenParentView.findViewController() as? HomeIndicatorViewController { - customRootViewController.prefersAutoHidden = true - customRootViewController.setNeedsUpdateOfHomeIndicatorAutoHidden() - } + setHomeIndicatorHidden(true) } self.rnInlineMode = .fullscreen } private func exitFullscreen() { // stop hiding home indicator - if let fullscreenParentView = self.view?.findParentViewOfType(RCTRootContentView.self), - let customRootViewController = fullscreenParentView.findViewController() as? HomeIndicatorViewController { - customRootViewController.prefersAutoHidden = false - customRootViewController.setNeedsUpdateOfHomeIndicatorAutoHidden() - } + setHomeIndicatorHidden(false) // move the player if let containerView = self.containerView, @@ -89,6 +82,16 @@ public class THEOplayerRCTPresentationModeManager { } self.rnInlineMode = .inline } + + private func setHomeIndicatorHidden(_ hidden: Bool) { +#if os(iOS) + if let fullscreenParentView = self.view?.findParentViewOfType(RCTRootContentView.self), + let customRootViewController = fullscreenParentView.findViewController() as? HomeIndicatorViewController { + customRootViewController.prefersAutoHidden = hidden + customRootViewController.setNeedsUpdateOfHomeIndicatorAutoHidden() + } +#endif + } func setPresentationModeFromRN(newPresentationMode: THEOplayerSDK.PresentationMode) { guard newPresentationMode != self.presentationMode else { return } diff --git a/ios/viewController/HomeIndicatorViewController.swift b/ios/viewController/HomeIndicatorViewController.swift index 5caeef7ea..16d0f4b7f 100644 --- a/ios/viewController/HomeIndicatorViewController.swift +++ b/ios/viewController/HomeIndicatorViewController.swift @@ -6,9 +6,11 @@ import UIKit public class HomeIndicatorViewController: UIViewController { public var prefersAutoHidden = false +#if os(iOS) public override var prefersHomeIndicatorAutoHidden: Bool { get { return self.prefersAutoHidden } } +#endif } diff --git a/package-lock.json b/package-lock.json index bb4ad843e..a7e473eb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-theoplayer", - "version": "8.8.0", + "version": "8.8.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-native-theoplayer", - "version": "8.8.0", + "version": "8.8.1", "license": "SEE LICENSE AT https://www.theoplayer.com/terms", "dependencies": { "buffer": "^6.0.3" diff --git a/package.json b/package.json index c6423d7ff..8ca48c2b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-theoplayer", - "version": "8.8.0", + "version": "8.8.1", "description": "A THEOplayer video component for react-native.", "main": "lib/commonjs/index", "module": "lib/module/index",