-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(android): Support Common Media Client Data (CMCD) #4034
feat(android): Support Common Media Client Data (CMCD) #4034
Conversation
…VideoSrc type to enable cmcd feature on android feat(video.ts): introduce CmcdMode enum and CmcdConfiguration type to define cmcd configuration options
…t to handle Content Management and Delivery (CMCD) headers for Android platform.
…ties and parsing logic for React Native module
…n for ExoPlayer with support for custom data and configuration options.
…ion in ReactExoplayerViewManager to enable Content Management and Control Data (CMCD) for better video playback optimization.
…ion.Factory to customize CMCD configuration for media playback
… to enhance functionality and data handling
… the component, including usage examples and default values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 left two small comments - Thanks for opening this PR
@YangJonghun cloud you also review this PR? @freeboub is on vacation and I would like also to someone else to review
android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java
Outdated
Show resolved
Hide resolved
@KrzysztofMoch I've already reviewed this PR :) |
… prevCmcdConfig variables to clean up code and improve readability
…dability and maintainability
feat(props.mdx): add definitions for CmcdMode enum and CmcdData type to enhance understanding of CMCD data structure and usage
I have a suggestion. I think we should change the |
…proved readability and immutability - update CMCDProps class to use List instead of Array for properties
✅ 488f498 Hi, Thank you for the great review. As you suggested, I have changed it to a data class. |
397edc4
to
488f498
Compare
@uncoolclub thanks for applying my suggestion. |
@seyedmostafahasani |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 small comments, but it looks great 👍
android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java
Outdated
Show resolved
Hide resolved
My suggestion is regarding |
@seyedmostafahasani If it's in the comments, I can't find it, so could you please provide the suggestion again? |
…de readability and reduce duplication
…ReactExoplayerView component feat(ReactExoplayerViewManager.java): remove redundant CMCD configuration logic from ReactExoplayerViewManager to simplify code and improve maintainability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One remaining comment, can you please check it. After that It will be ok for me !
Thank you for the PR !
@uncoolclub, |
@seyedmostafahasani ✅ 1e9c258 |
@KrzysztofMoch this PR can also be merged I think |
Summary
This PR adds support for CMCD (Common Media Client Data) in the ExoPlayer implementation of react-native-video. CMCD is a standard that allows clients to communicate QoE metrics and other contextual data to CDN providers and origin servers, enabling better analytics and potentially improved streaming performance.
Motivation
CMCD support is becoming increasingly important for video streaming applications, as it allows for better analytics and potential optimizations on the server side. By implementing CMCD in react-native-video, we enable developers to take advantage of these benefits in their React Native applications.
Changes
CMCDConfig
class to handle CMCD configuration.ReactExoplayerView
to support setting CMCD configuration.ReactExoplayerViewManager
to handle CMCD prop from React Native.Test plan
To test this change:
Test
1. CMCD Disabled (Default Behavior)
Test Case
cmcd: false
or omit thecmcd
propertyCode
Result
CMCD was not activated, as confirmed in Android Studio's App Inspection > Network Inspector.
2. Default CMCD Configuration
Test Case
cmcd: true
Code
Result
CMCD was activated with default settings (query parameters), as verified in Android Studio's App Inspection > Network Inspector.
3. Custom CMCD Configuration with Request Header Mode
Test Case
CmcdMode.MODE_REQUEST_HEADER
Code
Result
Custom CMCD configuration was successfully applied using the request header mode.
4. Custom CMCD Configuration with Default Mode
Test Case
Code
Result
Custom CMCD configuration was successfully applied using the default query parameter mode.