2

I am using this react-native-video this forked version of original react-native-video because it has a DRM support. I check their DRM doc too. But cannot get any success. This is the example how I am trying to implement DRM. But cannot make video play. Its shows no any errors or warnings.

 <Video
        source={{
          uri:
            "https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd"
        }}
        drm={{
          type: "widevine",
          licenseServer:
            "https://drm-widevine-licensing.axtest.net/AcquireLicense",
          headers: {
            "X-AxDRM-Message":
              "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU"
          }
        }}

        ref={ref => {
          this.player = ref;
        }}
        style={styles.backgroundVideo}
      />
Kais
  • 1,925
  • 3
  • 23
  • 35

1 Answers1

2

try

<Video
source={{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine',
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}}
 style={styles.backgroundVideo}
/>
sachin mathew
  • 1,432
  • 11
  • 19
  • when I do as suggested above, get the following error in Android logcat with no video being played : - `E/MediaPlayerNative: error (1, -2147483648) E/MediaPlayer: Error (1,-2147483648)` – aprofromindia Aug 03 '20 at 17:43
  • @Sachin I have tried the same but cookies are not getting sent. Look at here please https://stackoverflow.com/questions/74680861/react-native-video-how-to-send-cloudfront-signed-cookies – Faisal Shaikh Dec 07 '22 at 21:05