Skip to content

Use onTouchEnd to fix Chromecast button non responsive on Android#115

Merged
OlegRyz merged 6 commits into
mainfrom
bugfix/android-chromecast-button-non-responsive
May 28, 2026
Merged

Use onTouchEnd to fix Chromecast button non responsive on Android#115
OlegRyz merged 6 commits into
mainfrom
bugfix/android-chromecast-button-non-responsive

Conversation

@OlegRyz

@OlegRyz OlegRyz commented May 18, 2026

Copy link
Copy Markdown
Contributor

The onStartShouldSetResponder on the outer Animated.View was claiming the touch responder, preventing the native MediaRouteButton from receiving taps. Replacing it with a
onTouchEnd listener preserves the fade-in behavior without intercepting touches meant for native child views.

@changeset-bot

changeset-bot Bot commented May 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a2a2e80

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@theoplayer/react-native-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

onTouchMove={onUserAction_}
onStartShouldSetResponder={() => true}
onResponderRelease={onUserAction_}
onTouchEnd={onUserAction_}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still work on platforms without touch events, i.e. desktop browsers?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed it doesn't work for click events, but UI was showing because of onTouchMove initiated. I added onClick to keep showing UI for clicks without movement on web browsers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the type checker doesn't like it...

  Property 'onClick' does not exist on type 'IntrinsicAttributes & AnimatedProps<ViewProps & RefAttributes<View>>'.

440         onClick={onUserAction_}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a wrong way for introducing onClick. However worked runtime... I pushed the proper way now.

@OlegRyz OlegRyz force-pushed the bugfix/android-chromecast-button-non-responsive branch from e2489bb to 4f68630 Compare May 19, 2026 14:46

@tvanlaerhoven tvanlaerhoven left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also verified with the linked example app.

const babelLoaderConfiguration = {
test: [/\.tsx?$/, /.*@theoplayer\/.*\.js$/],
exclude: ['/**/*.d.ts', '/**/node_modules/'],
exclude: [/\.d\.ts$/, /cmcd-connector\.esm\.js$/],

@MattiasBuelens MattiasBuelens May 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? What's wrong with cmcd-connector.esm.js? 😕

Could you at least add a comment?

@OlegRyz OlegRyz merged commit ba8f7e0 into main May 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants