THEOplayer / react-native-connectors

THEOplayer React Native connectors
MIT License
3 stars 4 forks source link

Unable to build iOS/tvOS #189

Closed danychi closed 2 months ago

danychi commented 5 months ago

I just updated react-native-theoplayer@7.0.0 and @theoplayer/react-native-analytics-youbora@1.2.0 and when running iOS, I am getting the following error:

Screenshot 2024-04-12 at 11 33 13

/ios/Pods/YouboraTHEOPlayerAdapter/YouboraTHEOPlayerAdapter tvOS/YBTHEOPlayerAdapter.swift:351:20 Value of type 'THEOplayer' has no member 'requestVideoWidth'

Is it maybe a side effect of updating react-native-theoplayer to its latest version? 🤔

michelecocuccio commented 5 months ago

same here using react-native-theoplayer@7.0.0 and @theoplayer/react-native-analytics-youbora@1.2.0

  206 |     override public func getPlayhead() -> NSNumber? {
  207 |         if let player = player as? THEOplayer {
> 208 |             player.requestCurrentTime(completionHandler: {(currentTime,error) in
      |                    ^ value of type 'THEOplayer' has no member 'requestCurrentTime'
  209 |                 self.lastReportedPlayhead = currentTime!
  210 |             })
  211 |         }
  349 |             }
  350 |
> 351 |             player.requestVideoWidth { (width, error) in
      |                    ^ value of type 'THEOplayer' has no member 'requestVideoWidth'
  352 |                 if let width = width {
  353 |                     self.lastReportedWidth = width
  354 |                 }

  355 |             }
  356 |
> 357 |             player.requestVideoHeight { (height, error) in
      |                    ^ value of type 'THEOplayer' has no member 'requestVideoHeight'
  358 |                 if let height = height {
  359 |                     self.lastReportedHeight = height
  360 |                 }
michelecocuccio commented 5 months ago

Any news on this? it has been several weeks now and this issue still persist

tvanlaerhoven commented 4 months ago

@michelecocuccio you'll have to upgrade your react-native-theoplayer package to at least v7.2.0. It looks like we didn't restrict the version needed by the latest changes in the youbora connector.

wvanhaevre commented 4 months ago

On the native iOS SDK some async API's have been deprecated, replacing them with a sync version. It looks like this connector is not updated accordingly. Instead of

  351 |             player.requestVideoWidth { (width, error) in
  352 |                 if let width = width {
  353 |                     self.lastReportedWidth = width
  354 |                 }
  355 |             }

We should now use

  352 |                 if let width = player.videoWidth  {
  353 |                     self.lastReportedWidth = width
  354 |                 }
  355 |             

You can already patch your local version if you like. We'll prepare an update of the connector.

wvanhaevre commented 4 months ago

What version of the YouboraTHEOPlayerAdapter pod is installed? I checked and the latest version does use the correct API. I'm running react-native-theoplayer 7.3.0 and a pod install of the youbora connector installs the following pods: Installing YouboraLib (6.7.11) Installing YouboraTHEOPlayerAdapter (6.7.1) Installing react-native-theoplayer-youbora (1.2.0)

wvanhaevre commented 4 months ago

Which has the following implementation on getRendition() Screenshot 2024-06-06 at 14 47 14

wvanhaevre commented 4 months ago

We indeed do not set a minimum version on the Adapter pod in our connector's podspec.

s.dependency "YouboraTHEOPlayerAdapter"

I think a pod update should do the trick.

tvanlaerhoven commented 2 months ago

Closing this ticket for now.