TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://docs.thewidlarzgroup.com/react-native-video/
MIT License
7.21k stars 2.9k forks source link

iOS DRM not working #2422

Closed mezalejandro closed 2 years ago

mezalejandro commented 3 years ago

Bug

Hello everybody, I am trying to use DRM on android it works fine but not on iOS.

Platform

Which player are you experiencing the problem on:

Environment info

React native info output:

 System:
    OS: macOS 11.4
    CPU: (8) x64 Apple M1
    Memory: 35.60 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.0 - /usr/local/bin/node
    Yarn: 1.22.4 - ~/workspaces/myapp/node_modules/.bin/yarn
    npm: 6.14.13 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK:
      API Levels: 29, 30
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.3
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.2 AI-202.7660.26.42.7351085
    Xcode: 12.5/12E262 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.2 => 0.64.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: ^5.1.1

Steps To Reproduce

Add licenseServer and certificateUrl in drm prop

Reproducible sample code

<Video 
          source = {{
            uri: 'https://xxx.cloudfront.net/out/v1/xxxxx/index.m3u8',
            type: 'm3u8'
          }}
          drm = {{
              type: 'fairplay',
              licenseServer: 'https://fps.ezdrm.com/api/licenses/XXXX-XXX-XXX',
              certificateUrl: 'https://xxx.cloudfront.net/live/players/test/1.0/fairplay.cer'
          }}
          onError={(err) => console.log('error ', err)}
          style={styles.backgroundVideo} />
KrzysztofGastolek commented 3 years ago

Did you use this DRM provider before with other solutions? Like web player (videojs)?

mezalejandro commented 3 years ago

@KrzysztofGastolek if I have a html with video that works on iOS devices, mac os

mezalejandro commented 3 years ago

I am testing on a physical device and from xcode this appears:

Screen Shot 2021-07-15 at 10 27 43 Screen Shot 2021-07-15 at 10 28 05
mmajk55 commented 3 years ago

@mezalejandro I'm having the same issue, did you solved it?

zhulduz commented 3 years ago
  1. Be sure that the license url is correct
  2. Try to use getLicense method instead of licenseServer property https://github.com/react-native-video/react-native-video/blob/master/DRM.md#getlicense
zhulduz commented 3 years ago

@mmajk55 check the second argument in the method getLicense https://github.com/react-native-video/react-native-video/blob/master/Video.js#L240