jwplayer / jwplayer-react-native

MIT License
32 stars 9 forks source link

[BUG] Chromecast(ios, android) and onTime event (ios) #16

Open leinnus opened 6 months ago

leinnus commented 6 months ago

IOS onTimeEvent ontime event does not work. but android work.

sample source onTime={event => onTime(event)}

const onTime = async e => { console.log('onTime', e); const {position, duration} = e.nativeEvent; }

IOS Exit Chromecast After Chromecast ends, there is no video on the screen, only audio. It plays, but only a black screen appears.

after chromecast ends. 20240514_024247 20240514_024249

ANDROID Chromecast When Chromecast starts, the screen will be black. On iOS, the screen image before playback is displayed, but on Android, it is only displayed in black. And the screen subtitles and quality setting menu disappear. only speed setting menu appear.

android setting menu & black screen(chromecast) IMG_2820

additionally iOS setting menu work!!(chromecast) 20240514_015704

Device

Jmilham21 commented 6 months ago

@leinnus We agree that the IOS onTimeEvent not firing while casting is a bug. This will be prioritized and taken care of soon. From our first glance, we believe this is an issue in this codebase and not a Native SDK issue, so it is actionable by you or the open-source community if it's a blocking problem.

The second issue you raised here must be separated into a separate issue to be actioned. Also, I'm unsure if I understand the Bug you are raising. Please clearly state your expectation versus actual in a new Issue so we can determine if it is a bug.

jmurth1234 commented 6 months ago

For the iOS onTimeEvent we have a local patch applied on the previous version of this library:

--- a/ios/RNJWPlayer/RNJWPlayerViewController.swift
+++ b/ios/RNJWPlayer/RNJWPlayerViewController.swift
@@ -170,12 +170,12 @@ class RNJWPlayerViewController : JWPlayerViewController, JWPlayerViewControllerD

     // MARK: Time events

-    func onAdTimeEvent(time:JWTimeData) {
+    override func onAdTimeEvent(_ time:JWTimeData) {
         super.onAdTimeEvent(time)
         parentView?.onAdTime?(["position": time.position, "duration": time.duration])
     }

-    func onMediaTimeEvent(time:JWTimeData) {
+    override func onMediaTimeEvent(_ time:JWTimeData) {
         super.onMediaTimeEvent(time)
         parentView?.onTime?(["position": time.position, "duration": time.duration])
     }
Jmilham21 commented 6 months ago

For the iOS onTimeEvent we have a local patch applied on the previous version of this library:

--- a/ios/RNJWPlayer/RNJWPlayerViewController.swift
+++ b/ios/RNJWPlayer/RNJWPlayerViewController.swift
@@ -170,12 +170,12 @@ class RNJWPlayerViewController : JWPlayerViewController, JWPlayerViewControllerD

     // MARK: Time events

-    func onAdTimeEvent(time:JWTimeData) {
+    override func onAdTimeEvent(_ time:JWTimeData) {
         super.onAdTimeEvent(time)
         parentView?.onAdTime?(["position": time.position, "duration": time.duration])
     }

-    func onMediaTimeEvent(time:JWTimeData) {
+    override func onMediaTimeEvent(_ time:JWTimeData) {
         super.onMediaTimeEvent(time)
         parentView?.onTime?(["position": time.position, "duration": time.duration])
     }

@rymate1234 This will be resolved in 1.0.1