Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

[mux] A monitor for null has not been initialized #8

Open
siriwatknp opened this issue Nov 16, 2020 · 2 comments
Open

[mux] A monitor for null has not been initialized #8

siriwatknp opened this issue Nov 16, 2020 · 2 comments

Comments

@siriwatknp
Copy link

siriwatknp commented Nov 16, 2020

Currently when using react-native-video-controls instead of react-native-video the monitor throws an error:

image

"react-native": "0.61.5",
"mux-react-native-video-sdk": "https://github.com/muxinc/mux-stats-sdk-react-native-video#v0.1.0-beta.1",
"react-native-video": "^5.1.0-alpha8",
"react-native-video-controls": "^2.7.1"

using with react-native-video-controls throw error but with pure react-native-video works

sample code

import VideoPlayer from 'react-native-video-controls'

const MuxVideo = muxReactNativeVideo(VideoPlayer)

// render
  <MuxVideo
      source={{ uri }}
      // controls={false}
      style={style}
      onError={() => {
        setIsError(true)
      }}
      resizeMode={'contain'}
      disableBack
      muxOptions={{
        application_name: 'App',
        application_version: '1.0.0',
        data: {
          env_key: 'keey',
          player_software_version: '5.0.2',
          player_name: 'React Native Player',
          video_id: 'video-id',
          video_title: 'My awesome video',
        },
      }}
    />
@dylanjha dylanjha changed the title Mux throw error after video ends Update for compatability with react-native-video-controls Nov 16, 2020
@siriwatknp siriwatknp changed the title Update for compatability with react-native-video-controls [mux] A monitor for null has not been initialized Nov 17, 2020
@siriwatknp
Copy link
Author

video_id is required in muxOptions

  muxOptions={{
      application_name: 'KasetGo', // (required) the name of your application
      application_version: '1.0.0', // the version of your application (optional, but encouraged)
      data: {
        env_key: 'ge75aqmj46je04c9m3roe9qol', // (required)
        player_software_version: '5.0.2', // (optionaal, but encouraged) the version of react-native-video that you are using
        player_name: 'React Native Player', // See metadata docs for available metadata fields https://docs.mux.com/docs/web-integration-guide#section-5-add-metadata
        video_id: 'My Video Id',
        video_title: 'My awesome video',
      },
    }}

@stevenlyons
Copy link

Hi @siriwatknp apologies for the very delayed response and fix. This issue should be resolved in the latest v0.3.0 release. We've removed the code that was generating a video_id if one wasn't passed, which should resolve this issue. If you are able, could you test again and verify the new version fixes this issue for you?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants