| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  | import React, { Component } from 'react'; | 
					
						
							| 
									
										
										
										
											2017-08-04 21:53:53 +03:00
										 |  |  | import PropTypes from 'prop-types'; | 
					
						
							| 
									
										
										
										
											2022-05-04 12:34:28 -07:00
										 |  |  | import { StyleSheet, requireNativeComponent, NativeModules, UIManager, View, Image, Platform, findNodeHandle } from 'react-native'; | 
					
						
							| 
									
										
										
										
											2022-06-13 11:26:40 -04:00
										 |  |  | import { ViewPropTypes, ImagePropTypes } from 'deprecated-react-native-prop-types'; | 
					
						
							| 
									
										
										
										
											2016-06-22 15:52:12 +02:00
										 |  |  | import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource'; | 
					
						
							| 
									
										
										
										
											2018-06-12 21:04:15 -07:00
										 |  |  | import TextTrackType from './TextTrackType'; | 
					
						
							| 
									
										
										
										
											2018-11-06 08:38:28 -06:00
										 |  |  | import FilterType from './FilterType'; | 
					
						
							| 
									
										
											  
											
												Add iOS and Android basic DRM support (#1445)
This PR adds support for DRM streams on iOS (Fairplay) and Android (Playready, Widevine, Clearkey)
I am neither Android nor iOS developer, so feel free to provide feedback to improve this PR.
**Test stream for ANDROID:**
```
testStream = {
        uri: 'http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)',
        type: 'mpd',
        drm: {
            type: DRMType.PLAYREADY,
            licenseServer: 'http://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)'
        }
    };
```
or 
```
{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine', //or DRMType.WIDEVINE
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}
```
**Test stream for iOS:**
Sorry but I can not provide free streams to test. If anyone can provide test streams, or found some we can use, please let me know to also test them.
It has been tested with a private provider and they work, at least with the `getLicense` override method. (An example implementation is provided in the README)
											
										 
											2020-08-13 03:56:21 +02:00
										 |  |  | import DRMType from './DRMType'; | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  | import VideoResizeMode from './VideoResizeMode.js'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  | const styles = StyleSheet.create({ | 
					
						
							|  |  |  |   base: { | 
					
						
							|  |  |  |     overflow: 'hidden', | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-23 22:54:03 +02:00
										 |  |  | const { VideoDecoderProperties } = NativeModules | 
					
						
							|  |  |  | export { TextTrackType, FilterType, DRMType, VideoDecoderProperties } | 
					
						
							| 
									
										
										
										
											2018-06-12 21:04:15 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  | export default class Video extends Component { | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-06 05:57:35 +08:00
										 |  |  |   constructor(props) { | 
					
						
							|  |  |  |     super(props); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     this.state = { | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  |       showPoster: !!props.poster, | 
					
						
							| 
									
										
										
										
											2016-12-06 05:57:35 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-09 17:55:39 -08:00
										 |  |  |   setNativeProps(nativeProps) { | 
					
						
							|  |  |  |     this._root.setNativeProps(nativeProps); | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-13 21:28:24 +01:00
										 |  |  |   toTypeString(x) { | 
					
						
							|  |  |  |     switch (typeof x) { | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |       case 'object': | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  |         return x instanceof Date | 
					
						
							|  |  |  |           ? x.toISOString() | 
					
						
							| 
									
										
										
										
											2018-01-13 21:28:24 +01:00
										 |  |  |           : JSON.stringify(x); // object, null
 | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |       case 'undefined': | 
					
						
							|  |  |  |         return ''; | 
					
						
							| 
									
										
										
										
											2018-01-13 21:28:24 +01:00
										 |  |  |       default: // boolean, number, string
 | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  |         return x.toString(); | 
					
						
							| 
									
										
										
										
											2018-01-13 21:28:24 +01:00
										 |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   stringsOnlyObject(obj) { | 
					
						
							|  |  |  |     const strObj = {}; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Object.keys(obj).forEach(x => { | 
					
						
							|  |  |  |       strObj[x] = this.toTypeString(obj[x]); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return strObj; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2015-11-09 17:55:39 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-20 22:09:45 -07:00
										 |  |  |   seek = (time, tolerance = 100) => { | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |     if (isNaN(time)) {throw new Error('Specified time is not a number');} | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-20 22:09:45 -07:00
										 |  |  |     if (Platform.OS === 'ios') { | 
					
						
							|  |  |  |       this.setNativeProps({ | 
					
						
							|  |  |  |         seek: { | 
					
						
							|  |  |  |           time, | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |           tolerance, | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2018-06-20 22:09:45 -07:00
										 |  |  |       }); | 
					
						
							|  |  |  |     } else { | 
					
						
							|  |  |  |       this.setNativeProps({ seek: time }); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   presentFullscreenPlayer = () => { | 
					
						
							| 
									
										
										
										
											2016-03-31 20:36:39 +02:00
										 |  |  |     this.setNativeProps({ fullscreen: true }); | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-03-31 20:36:39 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   dismissFullscreenPlayer = () => { | 
					
						
							| 
									
										
										
										
											2016-04-01 11:12:50 +02:00
										 |  |  |     this.setNativeProps({ fullscreen: false }); | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-04-01 11:12:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-06 08:38:28 -06:00
										 |  |  |   save = async (options?) => { | 
					
						
							| 
									
										
										
										
											2018-10-26 08:21:41 -05:00
										 |  |  |     return await NativeModules.VideoManager.save(options, findNodeHandle(this._root)); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-26 14:23:04 -08:00
										 |  |  |   restoreUserInterfaceForPictureInPictureStopCompleted = (restored) => { | 
					
						
							|  |  |  |     this.setNativeProps({ restoreUserInterfaceForPIPStopCompletionHandler: restored }); | 
					
						
							| 
									
										
										
										
											2018-10-26 13:33:03 -07:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _assignRoot = (component) => { | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |     this._root = component; | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2015-11-11 13:34:41 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-19 12:00:57 +01:00
										 |  |  |   _hidePoster = () => { | 
					
						
							| 
									
										
										
										
											2019-06-20 09:24:12 +01:00
										 |  |  |     if (this.state.showPoster) { | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  |       this.setState({ showPoster: false }); | 
					
						
							| 
									
										
										
										
											2019-06-20 09:24:12 +01:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2019-06-19 12:00:57 +01:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onLoadStart = (event) => { | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |     if (this.props.onLoadStart) { | 
					
						
							|  |  |  |       this.props.onLoadStart(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2015-11-17 19:15:07 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-19 12:12:47 -04:00
										 |  |  |   _onPlaybackStateChanged = (event) => { | 
					
						
							|  |  |  |     if (this.props.onPlaybackStateChanged) { | 
					
						
							|  |  |  |       this.props.onPlaybackStateChanged(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onLoad = (event) => { | 
					
						
							| 
									
										
										
										
											2019-06-20 09:24:12 +01:00
										 |  |  |     // Need to hide poster here for windows as onReadyForDisplay is not implemented
 | 
					
						
							|  |  |  |     if (Platform.OS === 'windows') { | 
					
						
							|  |  |  |       this._hidePoster(); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |     if (this.props.onLoad) { | 
					
						
							|  |  |  |       this.props.onLoad(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2015-11-17 19:15:07 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-06 12:05:07 +02:00
										 |  |  |   _onAudioTracks = (event) => { | 
					
						
							|  |  |  |     if (this.props.onAudioTracks) { | 
					
						
							|  |  |  |       this.props.onAudioTracks(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   _onTextTracks = (event) => { | 
					
						
							|  |  |  |     if (this.props.onTextTracks) { | 
					
						
							|  |  |  |       this.props.onTextTracks(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   _onVideoTracks = (event) => { | 
					
						
							|  |  |  |     if (this.props.onVideoTracks) { | 
					
						
							|  |  |  |       this.props.onVideoTracks(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onError = (event) => { | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |     if (this.props.onError) { | 
					
						
							|  |  |  |       this.props.onError(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2015-11-17 19:15:07 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onProgress = (event) => { | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |     if (this.props.onProgress) { | 
					
						
							|  |  |  |       this.props.onProgress(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2015-11-17 19:15:07 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-25 21:53:11 +05:30
										 |  |  |   _onBandwidthUpdate = (event) => { | 
					
						
							|  |  |  |     if (this.props.onBandwidthUpdate) { | 
					
						
							|  |  |  |       this.props.onBandwidthUpdate(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2018-08-25 21:53:11 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onSeek = (event) => { | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |     if (this.props.onSeek) { | 
					
						
							|  |  |  |       this.props.onSeek(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2015-11-17 19:15:07 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onEnd = (event) => { | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |     if (this.props.onEnd) { | 
					
						
							|  |  |  |       this.props.onEnd(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2015-11-17 19:15:07 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-14 03:38:02 +01:00
										 |  |  |   _onTimedMetadata = (event) => { | 
					
						
							|  |  |  |     if (this.props.onTimedMetadata) { | 
					
						
							|  |  |  |       this.props.onTimedMetadata(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onFullscreenPlayerWillPresent = (event) => { | 
					
						
							| 
									
										
										
										
											2016-03-31 21:35:10 +02:00
										 |  |  |     if (this.props.onFullscreenPlayerWillPresent) { | 
					
						
							|  |  |  |       this.props.onFullscreenPlayerWillPresent(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-03-31 21:35:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onFullscreenPlayerDidPresent = (event) => { | 
					
						
							| 
									
										
										
										
											2016-03-31 21:40:49 +02:00
										 |  |  |     if (this.props.onFullscreenPlayerDidPresent) { | 
					
						
							| 
									
										
										
										
											2016-03-31 21:35:10 +02:00
										 |  |  |       this.props.onFullscreenPlayerDidPresent(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-03-31 21:35:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onFullscreenPlayerWillDismiss = (event) => { | 
					
						
							| 
									
										
										
										
											2016-03-31 21:40:49 +02:00
										 |  |  |     if (this.props.onFullscreenPlayerWillDismiss) { | 
					
						
							| 
									
										
										
										
											2016-03-31 21:35:10 +02:00
										 |  |  |       this.props.onFullscreenPlayerWillDismiss(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-03-31 21:35:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onFullscreenPlayerDidDismiss = (event) => { | 
					
						
							| 
									
										
										
										
											2016-03-31 21:35:10 +02:00
										 |  |  |     if (this.props.onFullscreenPlayerDidDismiss) { | 
					
						
							|  |  |  |       this.props.onFullscreenPlayerDidDismiss(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2015-11-17 19:15:07 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onReadyForDisplay = (event) => { | 
					
						
							| 
									
										
										
										
											2019-11-27 01:10:03 +05:30
										 |  |  |     if (!this.props.audioOnly) { | 
					
						
							|  |  |  |       this._hidePoster(); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  |     if (this.props.onReadyForDisplay) { | 
					
						
							|  |  |  |       this.props.onReadyForDisplay(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onPlaybackStalled = (event) => { | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  |     if (this.props.onPlaybackStalled) { | 
					
						
							|  |  |  |       this.props.onPlaybackStalled(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onPlaybackResume = (event) => { | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  |     if (this.props.onPlaybackResume) { | 
					
						
							|  |  |  |       this.props.onPlaybackResume(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   _onPlaybackRateChange = (event) => { | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  |     if (this.props.onPlaybackRateChange) { | 
					
						
							|  |  |  |       this.props.onPlaybackRateChange(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-06-22 16:28:54 +02:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-13 14:06:12 +02:00
										 |  |  |   _onExternalPlaybackChange = (event) => { | 
					
						
							|  |  |  |     if (this.props.onExternalPlaybackChange) { | 
					
						
							|  |  |  |       this.props.onExternalPlaybackChange(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-11 12:51:45 +00:00
										 |  |  |   _onAudioBecomingNoisy = () => { | 
					
						
							|  |  |  |     if (this.props.onAudioBecomingNoisy) { | 
					
						
							|  |  |  |       this.props.onAudioBecomingNoisy(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-26 14:23:04 -08:00
										 |  |  |   _onPictureInPictureStatusChanged = (event) => { | 
					
						
							|  |  |  |     if (this.props.onPictureInPictureStatusChanged) { | 
					
						
							|  |  |  |       this.props.onPictureInPictureStatusChanged(event.nativeEvent); | 
					
						
							| 
									
										
										
										
											2018-10-26 13:33:03 -07:00
										 |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-26 14:23:04 -08:00
										 |  |  |   _onRestoreUserInterfaceForPictureInPictureStop = (event) => { | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  |     if (this.props.onRestoreUserInterfaceForPictureInPictureStop) { | 
					
						
							| 
									
										
										
										
											2018-11-26 14:23:04 -08:00
										 |  |  |       this.props.onRestoreUserInterfaceForPictureInPictureStop(); | 
					
						
							| 
									
										
										
										
											2018-10-26 13:33:03 -07:00
										 |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-11 12:51:45 +00:00
										 |  |  |   _onAudioFocusChanged = (event) => { | 
					
						
							|  |  |  |     if (this.props.onAudioFocusChanged) { | 
					
						
							|  |  |  |       this.props.onAudioFocusChanged(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   _onBuffer = (event) => { | 
					
						
							|  |  |  |     if (this.props.onBuffer) { | 
					
						
							|  |  |  |       this.props.onBuffer(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Add iOS and Android basic DRM support (#1445)
This PR adds support for DRM streams on iOS (Fairplay) and Android (Playready, Widevine, Clearkey)
I am neither Android nor iOS developer, so feel free to provide feedback to improve this PR.
**Test stream for ANDROID:**
```
testStream = {
        uri: 'http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)',
        type: 'mpd',
        drm: {
            type: DRMType.PLAYREADY,
            licenseServer: 'http://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)'
        }
    };
```
or 
```
{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine', //or DRMType.WIDEVINE
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}
```
**Test stream for iOS:**
Sorry but I can not provide free streams to test. If anyone can provide test streams, or found some we can use, please let me know to also test them.
It has been tested with a private provider and they work, at least with the `getLicense` override method. (An example implementation is provided in the README)
											
										 
											2020-08-13 03:56:21 +02:00
										 |  |  |   _onGetLicense = (event) => { | 
					
						
							|  |  |  |     if (this.props.drm && this.props.drm.getLicense instanceof Function) { | 
					
						
							|  |  |  |       const data = event.nativeEvent; | 
					
						
							| 
									
										
										
										
											2021-01-13 19:18:01 +09:00
										 |  |  |       if (data && data.spcBase64) { | 
					
						
							|  |  |  |         const getLicenseOverride = this.props.drm.getLicense(data.spcBase64, data.contentId, data.licenseUrl); | 
					
						
							| 
									
										
											  
											
												Add iOS and Android basic DRM support (#1445)
This PR adds support for DRM streams on iOS (Fairplay) and Android (Playready, Widevine, Clearkey)
I am neither Android nor iOS developer, so feel free to provide feedback to improve this PR.
**Test stream for ANDROID:**
```
testStream = {
        uri: 'http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)',
        type: 'mpd',
        drm: {
            type: DRMType.PLAYREADY,
            licenseServer: 'http://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)'
        }
    };
```
or 
```
{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine', //or DRMType.WIDEVINE
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}
```
**Test stream for iOS:**
Sorry but I can not provide free streams to test. If anyone can provide test streams, or found some we can use, please let me know to also test them.
It has been tested with a private provider and they work, at least with the `getLicense` override method. (An example implementation is provided in the README)
											
										 
											2020-08-13 03:56:21 +02:00
										 |  |  |         const getLicensePromise = Promise.resolve(getLicenseOverride); // Handles both scenarios, getLicenseOverride being a promise and not.
 | 
					
						
							|  |  |  |         getLicensePromise.then((result => { | 
					
						
							|  |  |  |           if (result !== undefined) { | 
					
						
							|  |  |  |             NativeModules.VideoManager.setLicenseResult(result, findNodeHandle(this._root)); | 
					
						
							|  |  |  |           } else { | 
					
						
							|  |  |  |             NativeModules.VideoManager.setLicenseError && NativeModules.VideoManager.setLicenseError('Empty license result', findNodeHandle(this._root)); | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |         })).catch((error) => { | 
					
						
							|  |  |  |           NativeModules.VideoManager.setLicenseError && NativeModules.VideoManager.setLicenseError(error, findNodeHandle(this._root)); | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |       } else { | 
					
						
							| 
									
										
										
										
											2022-02-04 12:32:34 -08:00
										 |  |  |         NativeModules.VideoManager.setLicenseError && NativeModules.VideoManager.setLicenseError('No spc received', findNodeHandle(this._root)); | 
					
						
							| 
									
										
											  
											
												Add iOS and Android basic DRM support (#1445)
This PR adds support for DRM streams on iOS (Fairplay) and Android (Playready, Widevine, Clearkey)
I am neither Android nor iOS developer, so feel free to provide feedback to improve this PR.
**Test stream for ANDROID:**
```
testStream = {
        uri: 'http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)',
        type: 'mpd',
        drm: {
            type: DRMType.PLAYREADY,
            licenseServer: 'http://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)'
        }
    };
```
or 
```
{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine', //or DRMType.WIDEVINE
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}
```
**Test stream for iOS:**
Sorry but I can not provide free streams to test. If anyone can provide test streams, or found some we can use, please let me know to also test them.
It has been tested with a private provider and they work, at least with the `getLicense` override method. (An example implementation is provided in the README)
											
										 
											2020-08-13 03:56:21 +02:00
										 |  |  |       } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2021-07-26 16:11:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |   _onReceiveAdEvent = (event) => { | 
					
						
							|  |  |  |     if (this.props.onReceiveAdEvent) { | 
					
						
							|  |  |  |       this.props.onReceiveAdEvent(event.nativeEvent); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-18 16:47:20 +05:30
										 |  |  |   getViewManagerConfig = viewManagerName => { | 
					
						
							| 
									
										
										
										
											2021-11-15 15:57:24 -08:00
										 |  |  |     if (!UIManager.getViewManagerConfig) { | 
					
						
							|  |  |  |       return UIManager[viewManagerName]; | 
					
						
							| 
									
										
										
										
											2019-02-18 16:47:20 +05:30
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-11-15 15:57:24 -08:00
										 |  |  |     return UIManager.getViewManagerConfig(viewManagerName); | 
					
						
							| 
									
										
										
										
											2019-02-18 16:47:20 +05:30
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   render() { | 
					
						
							| 
									
										
										
										
											2016-06-22 15:52:12 +02:00
										 |  |  |     const resizeMode = this.props.resizeMode; | 
					
						
							|  |  |  |     const source = resolveAssetSource(this.props.source) || {}; | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |     const shouldCache = !source.__packager_asset; | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-28 17:46:30 -08:00
										 |  |  |     let uri = source.uri || ''; | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |     if (uri && uri.match(/^\//)) { | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |       uri = `file://${uri}`; | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-18 21:36:17 -08:00
										 |  |  |     if (!uri) { | 
					
						
							| 
									
										
										
										
											2022-09-14 21:57:37 +02:00
										 |  |  |       console.log('Trying to load empty source.'); | 
					
						
							| 
									
										
										
										
											2019-02-18 21:36:17 -08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-14 21:57:37 +02:00
										 |  |  |     const isNetwork = !!(uri && uri.match(/^https?:/i)); | 
					
						
							|  |  |  |     const isAsset = !!(uri && uri.match(/^(assets-library|ph|ipod-library|file|content|ms-appx|ms-appdata):/i)); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-02 21:33:03 +02:00
										 |  |  |     if ((uri || uri === '') && !isNetwork && !isAsset) { | 
					
						
							| 
									
										
										
										
											2022-09-14 21:57:37 +02:00
										 |  |  |       if (this.props.onError) { | 
					
						
							|  |  |  |         this.props.onError({error: {errorString: 'invalid url, player will stop', errorCode: 'INVALID_URL'}}); | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |     let nativeResizeMode; | 
					
						
							| 
									
										
										
										
											2019-02-18 16:47:20 +05:30
										 |  |  |     const RCTVideoInstance = this.getViewManagerConfig('RCTVideo'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |     if (resizeMode === VideoResizeMode.stretch) { | 
					
						
							| 
									
										
										
										
											2019-02-18 16:47:20 +05:30
										 |  |  |       nativeResizeMode = RCTVideoInstance.Constants.ScaleToFill; | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |     } else if (resizeMode === VideoResizeMode.contain) { | 
					
						
							| 
									
										
										
										
											2019-02-18 16:47:20 +05:30
										 |  |  |       nativeResizeMode = RCTVideoInstance.Constants.ScaleAspectFit; | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |     } else if (resizeMode === VideoResizeMode.cover) { | 
					
						
							| 
									
										
										
										
											2019-02-18 16:47:20 +05:30
										 |  |  |       nativeResizeMode = RCTVideoInstance.Constants.ScaleAspectFill; | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |     } else { | 
					
						
							| 
									
										
										
										
											2019-02-18 16:47:20 +05:30
										 |  |  |       nativeResizeMode = RCTVideoInstance.Constants.ScaleNone; | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-03 20:27:38 -08:00
										 |  |  |     const nativeProps = Object.assign({}, this.props); | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |     Object.assign(nativeProps, { | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |       style: [styles.base, nativeProps.style], | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |       resizeMode: nativeResizeMode, | 
					
						
							|  |  |  |       src: { | 
					
						
							| 
									
										
										
										
											2016-01-31 19:35:18 -08:00
										 |  |  |         uri, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |         isNetwork, | 
					
						
							|  |  |  |         isAsset, | 
					
						
							| 
									
										
										
										
											2019-01-24 13:15:58 +01:00
										 |  |  |         shouldCache, | 
					
						
							| 
									
										
										
										
											2017-01-28 17:46:30 -08:00
										 |  |  |         type: source.type || '', | 
					
						
							| 
									
										
										
										
											2016-09-14 12:28:06 +01:00
										 |  |  |         mainVer: source.mainVer || 0, | 
					
						
							|  |  |  |         patchVer: source.patchVer || 0, | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |         requestHeaders: source.headers ? this.stringsOnlyObject(source.headers) : {}, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |       }, | 
					
						
							| 
									
										
										
										
											2015-11-11 13:34:41 -08:00
										 |  |  |       onVideoLoadStart: this._onLoadStart, | 
					
						
							| 
									
										
										
										
											2022-04-19 12:12:47 -04:00
										 |  |  |       onVideoPlaybackStateChanged: this._onPlaybackStateChanged, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |       onVideoLoad: this._onLoad, | 
					
						
							| 
									
										
										
										
											2022-08-06 12:05:07 +02:00
										 |  |  |       onAudioTracks: this._onAudioTracks, | 
					
						
							|  |  |  |       onTextTracks: this._onTextTracks, | 
					
						
							|  |  |  |       onVideoTracks: this._onVideoTracks, | 
					
						
							| 
									
										
										
										
											2015-11-11 13:34:41 -08:00
										 |  |  |       onVideoError: this._onError, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |       onVideoProgress: this._onProgress, | 
					
						
							| 
									
										
										
										
											2015-11-11 13:34:41 -08:00
										 |  |  |       onVideoSeek: this._onSeek, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |       onVideoEnd: this._onEnd, | 
					
						
							| 
									
										
										
										
											2017-01-11 12:51:45 +00:00
										 |  |  |       onVideoBuffer: this._onBuffer, | 
					
						
							| 
									
										
										
										
											2018-11-01 21:41:57 +05:30
										 |  |  |       onVideoBandwidthUpdate: this._onBandwidthUpdate, | 
					
						
							| 
									
										
										
										
											2017-02-14 03:38:02 +01:00
										 |  |  |       onTimedMetadata: this._onTimedMetadata, | 
					
						
							| 
									
										
										
										
											2018-07-12 21:48:58 -07:00
										 |  |  |       onVideoAudioBecomingNoisy: this._onAudioBecomingNoisy, | 
					
						
							| 
									
										
										
										
											2018-10-07 15:59:10 -07:00
										 |  |  |       onVideoExternalPlaybackChange: this._onExternalPlaybackChange, | 
					
						
							| 
									
										
										
										
											2016-03-31 21:35:10 +02:00
										 |  |  |       onVideoFullscreenPlayerWillPresent: this._onFullscreenPlayerWillPresent, | 
					
						
							|  |  |  |       onVideoFullscreenPlayerDidPresent: this._onFullscreenPlayerDidPresent, | 
					
						
							|  |  |  |       onVideoFullscreenPlayerWillDismiss: this._onFullscreenPlayerWillDismiss, | 
					
						
							|  |  |  |       onVideoFullscreenPlayerDidDismiss: this._onFullscreenPlayerDidDismiss, | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  |       onReadyForDisplay: this._onReadyForDisplay, | 
					
						
							|  |  |  |       onPlaybackStalled: this._onPlaybackStalled, | 
					
						
							|  |  |  |       onPlaybackResume: this._onPlaybackResume, | 
					
						
							|  |  |  |       onPlaybackRateChange: this._onPlaybackRateChange, | 
					
						
							| 
									
										
										
										
											2017-01-11 12:51:45 +00:00
										 |  |  |       onAudioFocusChanged: this._onAudioFocusChanged, | 
					
						
							|  |  |  |       onAudioBecomingNoisy: this._onAudioBecomingNoisy, | 
					
						
							| 
									
										
											  
											
												Add iOS and Android basic DRM support (#1445)
This PR adds support for DRM streams on iOS (Fairplay) and Android (Playready, Widevine, Clearkey)
I am neither Android nor iOS developer, so feel free to provide feedback to improve this PR.
**Test stream for ANDROID:**
```
testStream = {
        uri: 'http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)',
        type: 'mpd',
        drm: {
            type: DRMType.PLAYREADY,
            licenseServer: 'http://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)'
        }
    };
```
or 
```
{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine', //or DRMType.WIDEVINE
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}
```
**Test stream for iOS:**
Sorry but I can not provide free streams to test. If anyone can provide test streams, or found some we can use, please let me know to also test them.
It has been tested with a private provider and they work, at least with the `getLicense` override method. (An example implementation is provided in the README)
											
										 
											2020-08-13 03:56:21 +02:00
										 |  |  |       onGetLicense: nativeProps.drm && nativeProps.drm.getLicense && this._onGetLicense, | 
					
						
							| 
									
										
										
										
											2018-11-26 14:23:04 -08:00
										 |  |  |       onPictureInPictureStatusChanged: this._onPictureInPictureStatusChanged, | 
					
						
							|  |  |  |       onRestoreUserInterfaceForPictureInPictureStop: this._onRestoreUserInterfaceForPictureInPictureStop, | 
					
						
							| 
									
										
										
										
											2021-07-26 16:11:37 +03:00
										 |  |  |       onReceiveAdEvent: this._onReceiveAdEvent, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-04 17:28:33 -04:00
										 |  |  |     const posterStyle = { | 
					
						
							|  |  |  |       ...StyleSheet.absoluteFillObject, | 
					
						
							|  |  |  |       resizeMode: this.props.posterResizeMode || 'contain', | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2016-12-06 05:57:35 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-09 17:55:39 -08:00
										 |  |  |     return ( | 
					
						
							| 
									
										
										
										
											2020-06-11 16:44:13 +02:00
										 |  |  |       <View style={nativeProps.style}> | 
					
						
							| 
									
										
										
										
											2019-06-19 10:39:35 +01:00
										 |  |  |         <RCTVideo | 
					
						
							|  |  |  |           ref={this._assignRoot} | 
					
						
							|  |  |  |           {...nativeProps} | 
					
						
							|  |  |  |           style={StyleSheet.absoluteFill} | 
					
						
							|  |  |  |         /> | 
					
						
							| 
									
										
										
										
											2019-06-19 12:00:57 +01:00
										 |  |  |         {this.state.showPoster && ( | 
					
						
							| 
									
										
										
										
											2019-06-19 14:19:06 +01:00
										 |  |  |           <Image style={posterStyle} source={{ uri: this.props.poster }} /> | 
					
						
							| 
									
										
										
										
											2019-06-19 10:39:35 +01:00
										 |  |  |         )} | 
					
						
							|  |  |  |       </View> | 
					
						
							| 
									
										
										
										
											2015-11-09 17:55:39 -08:00
										 |  |  |     ); | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Video.propTypes = { | 
					
						
							| 
									
										
										
										
											2018-11-06 08:38:28 -06:00
										 |  |  |   filter: PropTypes.oneOf([ | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  |     FilterType.NONE, | 
					
						
							|  |  |  |     FilterType.INVERT, | 
					
						
							|  |  |  |     FilterType.MONOCHROME, | 
					
						
							|  |  |  |     FilterType.POSTERIZE, | 
					
						
							|  |  |  |     FilterType.FALSE, | 
					
						
							|  |  |  |     FilterType.MAXIMUMCOMPONENT, | 
					
						
							|  |  |  |     FilterType.MINIMUMCOMPONENT, | 
					
						
							|  |  |  |     FilterType.CHROME, | 
					
						
							|  |  |  |     FilterType.FADE, | 
					
						
							|  |  |  |     FilterType.INSTANT, | 
					
						
							|  |  |  |     FilterType.MONO, | 
					
						
							|  |  |  |     FilterType.NOIR, | 
					
						
							|  |  |  |     FilterType.PROCESS, | 
					
						
							|  |  |  |     FilterType.TONAL, | 
					
						
							|  |  |  |     FilterType.TRANSFER, | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |     FilterType.SEPIA, | 
					
						
							| 
									
										
										
										
											2018-11-06 08:38:28 -06:00
										 |  |  |   ]), | 
					
						
							| 
									
										
										
										
											2018-12-13 21:30:38 -06:00
										 |  |  |   filterEnabled: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   /* Native only */ | 
					
						
							|  |  |  |   src: PropTypes.object, | 
					
						
							| 
									
										
										
										
											2018-06-20 22:09:45 -07:00
										 |  |  |   seek: PropTypes.oneOfType([ | 
					
						
							|  |  |  |     PropTypes.number, | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |     PropTypes.object, | 
					
						
							| 
									
										
										
										
											2018-06-20 22:09:45 -07:00
										 |  |  |   ]), | 
					
						
							| 
									
										
										
										
											2016-03-31 20:36:39 +02:00
										 |  |  |   fullscreen: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2016-12-13 00:16:11 +00:00
										 |  |  |   onVideoLoadStart: PropTypes.func, | 
					
						
							|  |  |  |   onVideoLoad: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2017-01-11 12:51:45 +00:00
										 |  |  |   onVideoBuffer: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2016-12-13 00:16:11 +00:00
										 |  |  |   onVideoError: PropTypes.func, | 
					
						
							|  |  |  |   onVideoProgress: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2018-11-01 21:41:57 +05:30
										 |  |  |   onVideoBandwidthUpdate: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2016-12-13 00:16:11 +00:00
										 |  |  |   onVideoSeek: PropTypes.func, | 
					
						
							|  |  |  |   onVideoEnd: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2017-02-14 03:38:02 +01:00
										 |  |  |   onTimedMetadata: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2018-07-12 21:48:58 -07:00
										 |  |  |   onVideoAudioBecomingNoisy: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2018-10-07 15:59:10 -07:00
										 |  |  |   onVideoExternalPlaybackChange: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2016-12-13 00:16:11 +00:00
										 |  |  |   onVideoFullscreenPlayerWillPresent: PropTypes.func, | 
					
						
							|  |  |  |   onVideoFullscreenPlayerDidPresent: PropTypes.func, | 
					
						
							|  |  |  |   onVideoFullscreenPlayerWillDismiss: PropTypes.func, | 
					
						
							|  |  |  |   onVideoFullscreenPlayerDidDismiss: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   /* Wrapper component */ | 
					
						
							| 
									
										
										
										
											2016-06-22 15:52:12 +02:00
										 |  |  |   source: PropTypes.oneOfType([ | 
					
						
							|  |  |  |     PropTypes.shape({ | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |       uri: PropTypes.string, | 
					
						
							| 
									
										
										
										
											2016-06-22 15:52:12 +02:00
										 |  |  |     }), | 
					
						
							|  |  |  |     // Opaque type returned by require('./video.mp4')
 | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |     PropTypes.number, | 
					
						
							| 
									
										
										
										
											2016-06-22 15:52:12 +02:00
										 |  |  |   ]), | 
					
						
							| 
									
										
											  
											
												Add iOS and Android basic DRM support (#1445)
This PR adds support for DRM streams on iOS (Fairplay) and Android (Playready, Widevine, Clearkey)
I am neither Android nor iOS developer, so feel free to provide feedback to improve this PR.
**Test stream for ANDROID:**
```
testStream = {
        uri: 'http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)',
        type: 'mpd',
        drm: {
            type: DRMType.PLAYREADY,
            licenseServer: 'http://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)'
        }
    };
```
or 
```
{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine', //or DRMType.WIDEVINE
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}
```
**Test stream for iOS:**
Sorry but I can not provide free streams to test. If anyone can provide test streams, or found some we can use, please let me know to also test them.
It has been tested with a private provider and they work, at least with the `getLicense` override method. (An example implementation is provided in the README)
											
										 
											2020-08-13 03:56:21 +02:00
										 |  |  |   drm: PropTypes.shape({ | 
					
						
							|  |  |  |     type: PropTypes.oneOf([ | 
					
						
							| 
									
										
										
										
											2022-02-04 12:32:34 -08:00
										 |  |  |       DRMType.CLEARKEY, DRMType.FAIRPLAY, DRMType.WIDEVINE, DRMType.PLAYREADY, | 
					
						
							| 
									
										
											  
											
												Add iOS and Android basic DRM support (#1445)
This PR adds support for DRM streams on iOS (Fairplay) and Android (Playready, Widevine, Clearkey)
I am neither Android nor iOS developer, so feel free to provide feedback to improve this PR.
**Test stream for ANDROID:**
```
testStream = {
        uri: 'http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)',
        type: 'mpd',
        drm: {
            type: DRMType.PLAYREADY,
            licenseServer: 'http://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:150)'
        }
    };
```
or 
```
{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine', //or DRMType.WIDEVINE
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}
```
**Test stream for iOS:**
Sorry but I can not provide free streams to test. If anyone can provide test streams, or found some we can use, please let me know to also test them.
It has been tested with a private provider and they work, at least with the `getLicense` override method. (An example implementation is provided in the README)
											
										 
											2020-08-13 03:56:21 +02:00
										 |  |  |     ]), | 
					
						
							|  |  |  |     licenseServer: PropTypes.string, | 
					
						
							|  |  |  |     headers: PropTypes.shape({}), | 
					
						
							|  |  |  |     base64Certificate: PropTypes.bool, | 
					
						
							|  |  |  |     certificateUrl: PropTypes.string, | 
					
						
							|  |  |  |     getLicense: PropTypes.func, | 
					
						
							|  |  |  |   }), | 
					
						
							| 
									
										
										
										
											2022-05-19 22:29:25 +09:00
										 |  |  |   localSourceEncryptionKeyScheme: PropTypes.string, | 
					
						
							| 
									
										
										
										
											2019-02-10 19:21:02 -08:00
										 |  |  |   minLoadRetryCount: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2018-11-26 14:50:31 -08:00
										 |  |  |   maxBitRate: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   resizeMode: PropTypes.string, | 
					
						
							| 
									
										
										
										
											2016-12-06 05:57:35 +08:00
										 |  |  |   poster: PropTypes.string, | 
					
						
							| 
									
										
										
										
											2022-06-13 11:26:40 -04:00
										 |  |  |   posterResizeMode: ImagePropTypes.resizeMode, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   repeat: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2019-08-22 10:10:39 +02:00
										 |  |  |   automaticallyWaitsToMinimizeStalling: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2018-06-06 10:22:19 +08:00
										 |  |  |   allowsExternalPlayback: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2018-07-17 14:14:21 -07:00
										 |  |  |   selectedAudioTrack: PropTypes.shape({ | 
					
						
							|  |  |  |     type: PropTypes.string.isRequired, | 
					
						
							|  |  |  |     value: PropTypes.oneOfType([ | 
					
						
							|  |  |  |       PropTypes.string, | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |       PropTypes.number, | 
					
						
							|  |  |  |     ]), | 
					
						
							| 
									
										
										
										
											2018-07-17 14:14:21 -07:00
										 |  |  |   }), | 
					
						
							| 
									
										
										
										
											2018-08-24 15:33:46 +05:30
										 |  |  |   selectedVideoTrack: PropTypes.shape({ | 
					
						
							|  |  |  |     type: PropTypes.string.isRequired, | 
					
						
							|  |  |  |     value: PropTypes.oneOfType([ | 
					
						
							|  |  |  |       PropTypes.string, | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |       PropTypes.number, | 
					
						
							|  |  |  |     ]), | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  |   }), | 
					
						
							| 
									
										
										
										
											2018-06-02 02:24:13 -07:00
										 |  |  |   selectedTextTrack: PropTypes.shape({ | 
					
						
							|  |  |  |     type: PropTypes.string.isRequired, | 
					
						
							|  |  |  |     value: PropTypes.oneOfType([ | 
					
						
							|  |  |  |       PropTypes.string, | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |       PropTypes.number, | 
					
						
							|  |  |  |     ]), | 
					
						
							| 
									
										
										
										
											2018-06-02 02:24:13 -07:00
										 |  |  |   }), | 
					
						
							| 
									
										
										
										
											2018-06-12 21:04:15 -07:00
										 |  |  |   textTracks: PropTypes.arrayOf( | 
					
						
							|  |  |  |     PropTypes.shape({ | 
					
						
							|  |  |  |       title: PropTypes.string, | 
					
						
							|  |  |  |       uri: PropTypes.string.isRequired, | 
					
						
							|  |  |  |       type: PropTypes.oneOf([ | 
					
						
							|  |  |  |         TextTrackType.SRT, | 
					
						
							|  |  |  |         TextTrackType.TTML, | 
					
						
							|  |  |  |         TextTrackType.VTT, | 
					
						
							|  |  |  |       ]), | 
					
						
							| 
									
										
										
										
											2020-02-22 13:56:31 -05:00
										 |  |  |       language: PropTypes.string.isRequired, | 
					
						
							| 
									
										
										
										
											2018-06-12 21:04:15 -07:00
										 |  |  |     }) | 
					
						
							|  |  |  |   ), | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   paused: PropTypes.bool, | 
					
						
							|  |  |  |   muted: PropTypes.bool, | 
					
						
							|  |  |  |   volume: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2018-08-02 09:20:08 +02:00
										 |  |  |   bufferConfig: PropTypes.shape({ | 
					
						
							| 
									
										
										
										
											2018-08-01 15:58:02 +02:00
										 |  |  |     minBufferMs: PropTypes.number, | 
					
						
							|  |  |  |     maxBufferMs: PropTypes.number, | 
					
						
							|  |  |  |     bufferForPlaybackMs: PropTypes.number, | 
					
						
							|  |  |  |     bufferForPlaybackAfterRebufferMs: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2021-11-04 13:54:43 -04:00
										 |  |  |     maxHeapAllocationPercent: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2018-08-01 15:58:02 +02:00
										 |  |  |   }), | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   rate: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2018-11-26 14:23:04 -08:00
										 |  |  |   pictureInPicture: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2015-12-16 13:53:04 +01:00
										 |  |  |   playInBackground: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2020-05-15 12:55:19 +05:30
										 |  |  |   preferredForwardBufferDuration: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2016-04-29 13:55:34 +02:00
										 |  |  |   playWhenInactive: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2017-04-20 13:10:06 -05:00
										 |  |  |   ignoreSilentSwitch: PropTypes.oneOf(['ignore', 'obey']), | 
					
						
							| 
									
										
										
										
											2018-08-25 21:53:11 +05:30
										 |  |  |   reportBandwidth: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2021-11-09 14:22:32 +02:00
										 |  |  |   contentStartTime: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2017-01-11 12:51:45 +00:00
										 |  |  |   disableFocus: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2022-09-26 01:51:18 +01:00
										 |  |  |   focusable: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2021-03-18 03:58:04 -07:00
										 |  |  |   disableBuffering: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2015-12-22 17:39:04 -06:00
										 |  |  |   controls: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2018-06-20 16:52:48 -07:00
										 |  |  |   audioOnly: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2015-12-22 17:39:04 -06:00
										 |  |  |   currentTime: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2018-10-18 15:21:46 -07:00
										 |  |  |   fullscreenAutorotate: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2020-01-29 03:51:21 +05:30
										 |  |  |   fullscreenOrientation: PropTypes.oneOf(['all', 'landscape', 'portrait']), | 
					
						
							| 
									
										
										
										
											2016-10-01 11:23:50 -07:00
										 |  |  |   progressUpdateInterval: PropTypes.number, | 
					
						
							| 
									
										
										
										
											2022-07-05 23:58:30 +02:00
										 |  |  |   subtitleStyle: PropTypes.shape({ | 
					
						
							|  |  |  |     paddingTop: PropTypes.number, | 
					
						
							|  |  |  |     paddingBottom: PropTypes.number, | 
					
						
							|  |  |  |     paddingLeft: PropTypes.number, | 
					
						
							|  |  |  |     paddingRight: PropTypes.number, | 
					
						
							|  |  |  |     fontSize: PropTypes.number, | 
					
						
							|  |  |  |   }), | 
					
						
							| 
									
										
										
										
											2018-06-08 00:01:13 -07:00
										 |  |  |   useTextureView: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2022-02-14 21:17:22 -04:00
										 |  |  |   useSecureView: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2018-11-28 14:56:58 +02:00
										 |  |  |   hideShutterView: PropTypes.bool, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   onLoadStart: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2022-04-19 12:12:47 -04:00
										 |  |  |   onPlaybackStateChanged: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   onLoad: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2022-08-06 12:05:07 +02:00
										 |  |  |   onAudioTracks: PropTypes.func, | 
					
						
							|  |  |  |   onTextTracks: PropTypes.func, | 
					
						
							|  |  |  |   onVideoTracks: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2017-01-11 12:51:45 +00:00
										 |  |  |   onBuffer: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   onError: PropTypes.func, | 
					
						
							|  |  |  |   onProgress: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2018-11-01 21:41:57 +05:30
										 |  |  |   onBandwidthUpdate: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2015-11-11 13:34:41 -08:00
										 |  |  |   onSeek: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   onEnd: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2016-03-31 21:35:10 +02:00
										 |  |  |   onFullscreenPlayerWillPresent: PropTypes.func, | 
					
						
							|  |  |  |   onFullscreenPlayerDidPresent: PropTypes.func, | 
					
						
							|  |  |  |   onFullscreenPlayerWillDismiss: PropTypes.func, | 
					
						
							|  |  |  |   onFullscreenPlayerDidDismiss: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2016-04-28 14:42:44 +02:00
										 |  |  |   onReadyForDisplay: PropTypes.func, | 
					
						
							|  |  |  |   onPlaybackStalled: PropTypes.func, | 
					
						
							|  |  |  |   onPlaybackResume: PropTypes.func, | 
					
						
							|  |  |  |   onPlaybackRateChange: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2017-01-11 12:51:45 +00:00
										 |  |  |   onAudioFocusChanged: PropTypes.func, | 
					
						
							|  |  |  |   onAudioBecomingNoisy: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2018-11-26 14:23:04 -08:00
										 |  |  |   onPictureInPictureStatusChanged: PropTypes.func, | 
					
						
							|  |  |  |   needsToRestoreUserInterfaceForPictureInPictureStop: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2018-09-13 14:06:12 +02:00
										 |  |  |   onExternalPlaybackChange: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2022-11-14 11:49:15 +01:00
										 |  |  |   adTagUrl: PropTypes.string, | 
					
						
							| 
									
										
										
										
											2022-11-16 12:11:28 +01:00
										 |  |  |   onReceiveAdEvent: PropTypes.func, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   /* Required by react-native */ | 
					
						
							| 
									
										
										
										
											2017-11-03 11:38:37 -07:00
										 |  |  |   ...ViewPropTypes, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-03 20:27:38 -08:00
										 |  |  | const RCTVideo = requireNativeComponent('RCTVideo', Video, { | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   nativeOnly: { | 
					
						
							|  |  |  |     src: true, | 
					
						
							|  |  |  |     seek: true, | 
					
						
							| 
									
										
										
										
											2016-04-01 11:12:50 +02:00
										 |  |  |     fullscreen: true, | 
					
						
							| 
									
										
										
										
											2015-10-29 17:26:28 -07:00
										 |  |  |   }, | 
					
						
							|  |  |  | }); |