Skip to content

Android bridge: several events not forwarded to JS #230

@Jmilham21

Description

@Jmilham21

Summary

Several RN events are declared in the TypeScript API and fire on iOS, but the Android bridge either has an empty SDK-delegate stub or never wires the SDK callback at all. The JS listener never fires on Android as a result.

Discovered during 1.5.0 QA by instrumenting every listener on TypeScriptExample.tsx and diffing iOS vs. Android payloads. None of these are regressions from 1.4.1 — they are long-standing gaps.

Empty SDK-delegate stubs (easy wins)

The Android bridge overrides the SDK callback but the method body is empty, so nothing is emitted:

Android SDK callback File / line TS event it should feed
onIdle(IdleEvent) RNJWPlayerView.java:2058 onIdle
onDisplayClick(DisplayClickEvent) RNJWPlayerView.java:2000 onScreenTapped
onControls(ControlsEvent) RNJWPlayerView.java:1995 possibly onControlBarVisible (already wired from a different callback — may be redundant)
onAdViewableImpression(AdViewableImpressionEvent) RNJWPlayerView.java:1893 could feed onAdEvent with a new type
onAudioTrackChanged(AudioTrackChangedEvent) RNJWPlayerView.java:1928 not yet in TS — would be a new event
onPipOpen(PipOpenEvent) / onPipClose(PipCloseEvent) RNJWPlayerView.java:2207/:2212 not yet in TS — would be new events
onMeta(MetaEvent) RNJWPlayerView.java:2200 not in TS

Zero emissions on Android (SDK hook not wired at all)

These TS events are fully wired on iOS (see references) but the Android bridge has no matching SDK-delegate registration:

TS event iOS source Android status
onPlayerWarning RNJWPlayerView.swift:1668 not wired
onScreenTapped RNJWPlayerView.swift:1734 empty onDisplayClick stub (see above)
onUpdateBuffer RNJWPlayerView.swift:1950 not wired (Android SDK exposes BufferChangeEvent)
onAttemptPlay RNJWPlayerView.swift:1958 not wired
onIdle RNJWPlayerView.swift:1981 empty stub (see above)
onVisible RNJWPlayerView.swift:1985 not wired
onPlayerSizeChange RNJWPlayerView.swift:1701,:1727 not wired

Some of these (onVisible, onPlayerSizeChange, onAttemptPlay) may not have a direct Android SDK delegate and would need to be synthesized from lifecycle / view hooks, like iOS does for onVisible via view attachment.

Related findings (deferred separately)

  • iOS onUpdateBuffer.position always null — bridge bug at RNJWPlayerView.swift:1950.
  • iOS onPlayerSizeChange.sizes always null — bridge bug at RNJWPlayerView.swift:1701 / :1727.
  • Android emits an extra "message": "<eventName>" field on every event that iOS does not. Consumer-visible; strip separately.
  • Minor onCaptionsList divergence: Android tracks have an extra file key (internal refs like "1/8219"), index 0 for Off vs iOS -1.

Acceptance

  • Wire each of the empty stubs that maps to an existing TS event.
  • Investigate an Android equivalent (or lifecycle-based approximation) for each of the zero-emission TS events.
  • Confirm payload shape matches iOS for anything newly wired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GroomedJWP team has reviewed the ticket and deemed it necessarybugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions