muxinc / mux-stats-sdk-react-native-video

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mux player event is not firing - videochange

amir-ibrahim opened this issue · comments

I'm trying to listen to mux player event with no success sample {videochange}

Screenshot 2023-04-26 at 9 40 11 AM

@amir-ibrahim thanks for opening the issue. I think there's a little bit of a mix up.

  • This repository is home to the SDK for Mux Data
  • videochange is a Mux Data API that you might need to use when you're swapping out the video in the same player (it really depends on your implementation, you may or may not have to use videochange)

In your comment, referring to Mux Player, is a Different SDK. Can you provide a little more details about what you're trying to accomplish so I can help point you in the right direction? Are you using Mux Player, or are you using this Mux Data SDK for React Native?

hello @dylanjha thank you for catching up I use muxReactNativeVideo
it's a horizontal story every time the user swipe I change the URL on the mux, this is my code:


import muxReactNativeVideo from 'mux-react-native-video-sdk';

const MuxVideo = muxReactNativeVideo(Video);

    <MuxVideo
                    style={{height: height, width: width}}
                    source={{
                      uri: `https://stream.mux.com/${content[current]?.playbackId}.m3u8`,
                    }}
                    muxOptions={{
                      application_name: _,
                      application_version: 1.0,
                      data: {
                        env_key: _,
                        video_id: content[current]?.playbackId,
                        video_title: `Story-${content[current]?.playbackId}`,
                        player_software_version: '5.0.2',
                        player_name: 'React Native Player',
                      },
                    }}
                    onLoadStart={() => {
                      setLoad(true);
                      setEnd(false);
                    }}
                    onLoad={data => {
                      let durationMillis = Math.floor(data.duration) * 1000;
                      start(durationMillis);
                      setLoad(false);
                    }}
                    onEnd={() => {
                      setEnd(true);
                    }}
                    resizeMode="stretch"
                  />

Got it, and what seems to be the issue you're running into?