Loading RCTVideo.m +42 −2 Changes for RCTVideo.m: 42 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,11 @@ id _progressUpdateTimer; int _progressUpdateInterval; NSDate *_prevProgressUpdateTime; /* Keep track of any modifiers, need to be applied after each play */ float _volume; float _rate; BOOL _muted; } - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher Loading Loading @@ -84,6 +89,9 @@ }]; [_player play]; /* rate and volume must be set after play is called */ [self applyModifiers]; } - (void)setResizeMode:(NSString*)mode Loading @@ -91,20 +99,52 @@ _playerLayer.videoGravity = mode; } - (void)setPause:(BOOL)wantsToPause - (void)setPaused:(BOOL)paused { if (wantsToPause) { if (paused) { [_player pause]; } else { [_player play]; } } - (void)setRate:(float)rate { _rate = rate; [self applyModifiers]; } - (void)setMuted:(BOOL)muted { _muted = muted; [self applyModifiers]; } - (void)setVolume:(float)volume { _volume = volume; [self applyModifiers]; } - (void)applyModifiers { /* volume must be set to 0 if muted is YES, or the video seems to * freeze */ if (_muted) { [_player setVolume:0]; [_player setMuted:YES]; } else { [_player setVolume:_volume]; [_player setMuted:NO]; } [_player setRate:_rate]; } - (void)playerItemDidReachEnd:(NSNotification *)notification { AVPlayerItem *item = [notification object]; [item seekToTime:kCMTimeZero]; [_player play]; [self applyModifiers]; } Loading RCTVideoManager.m +4 −1 Changes for RCTVideoManager.m: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -29,7 +29,10 @@ RCT_EXPORT_VIEW_PROPERTY(src, NSString); RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString); RCT_EXPORT_VIEW_PROPERTY(repeat, BOOL); RCT_EXPORT_VIEW_PROPERTY(pause, BOOL); RCT_EXPORT_VIEW_PROPERTY(paused, BOOL); RCT_EXPORT_VIEW_PROPERTY(muted, BOOL); RCT_EXPORT_VIEW_PROPERTY(volume, float); RCT_EXPORT_VIEW_PROPERTY(rate, float); - (NSDictionary *)constantsToExport { Loading README.md +4 −4 Changes for README.md: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -51,10 +51,10 @@ Example code [here](https://github.com/brentvatne/react-native-login/blob/master playing videos from phone's camera - [x] Switch to AVPlayer (0.1.6) - [x] Switch resizeMode to prop instead of style (0.1.7) - [x] Add `pause` prop (0.1.7) - [ ] Add `playbackRate` prop - [ ] Add `volume` prop - [ ] Add `muted` prop - [x] Add `paused` prop (0.1.7) - [x] Add `rate` prop - [x] Add `volume` prop - [x] Add `muted` prop - [x] Add some way to get back the `currentTime` value (0.1.9 - `onProgress` prop) - [x] Add some way to get back the `duration` value (0.1.8 - `onLoad` prop) - [ ] Add some way to interface with `seekToTime` Loading Video.ios.js +6 −2 Changes for Video.ios.js: 6 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -17,7 +17,10 @@ var Video = React.createClass({ style: StyleSheetPropType(VideoStylePropTypes), resizeMode: PropTypes.string, repeat: PropTypes.bool, pause: PropTypes.bool, paused: PropTypes.bool, muted: PropTypes.bool, volume: PropTypes.number, rate: PropTypes.number, onLoad: PropTypes.func, onProgress: PropTypes.func, }, Loading Loading @@ -66,7 +69,8 @@ var Video = React.createClass({ var RCTVideo = createReactIOSNativeComponentClass({ validAttributes: merge(ReactIOSViewAttributes.UIView, {src: true, resizeMode: true, repeat: true, pause: true}), {src: true, resizeMode: true, repeat: true, paused: true, muted: true, volume: true, rate: true}), uiViewClassName: 'RCTVideo', }); Loading package.json +1 −1 Changes for package.json: 1 added line, 1 removed line. Original line number Diff line number Diff line { "name": "react-native-video", "version": "0.2.3", "version": "0.2.4", "description": "A <Video> element for react-native", "main": "Video.ios.js", "author": "Brent Vatne <brentvatne@gmail.com> (https://github.com/brentvatne)", Loading Loading
RCTVideo.m +42 −2 Changes for RCTVideo.m: 42 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,11 @@ id _progressUpdateTimer; int _progressUpdateInterval; NSDate *_prevProgressUpdateTime; /* Keep track of any modifiers, need to be applied after each play */ float _volume; float _rate; BOOL _muted; } - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher Loading Loading @@ -84,6 +89,9 @@ }]; [_player play]; /* rate and volume must be set after play is called */ [self applyModifiers]; } - (void)setResizeMode:(NSString*)mode Loading @@ -91,20 +99,52 @@ _playerLayer.videoGravity = mode; } - (void)setPause:(BOOL)wantsToPause - (void)setPaused:(BOOL)paused { if (wantsToPause) { if (paused) { [_player pause]; } else { [_player play]; } } - (void)setRate:(float)rate { _rate = rate; [self applyModifiers]; } - (void)setMuted:(BOOL)muted { _muted = muted; [self applyModifiers]; } - (void)setVolume:(float)volume { _volume = volume; [self applyModifiers]; } - (void)applyModifiers { /* volume must be set to 0 if muted is YES, or the video seems to * freeze */ if (_muted) { [_player setVolume:0]; [_player setMuted:YES]; } else { [_player setVolume:_volume]; [_player setMuted:NO]; } [_player setRate:_rate]; } - (void)playerItemDidReachEnd:(NSNotification *)notification { AVPlayerItem *item = [notification object]; [item seekToTime:kCMTimeZero]; [_player play]; [self applyModifiers]; } Loading
RCTVideoManager.m +4 −1 Changes for RCTVideoManager.m: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -29,7 +29,10 @@ RCT_EXPORT_VIEW_PROPERTY(src, NSString); RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString); RCT_EXPORT_VIEW_PROPERTY(repeat, BOOL); RCT_EXPORT_VIEW_PROPERTY(pause, BOOL); RCT_EXPORT_VIEW_PROPERTY(paused, BOOL); RCT_EXPORT_VIEW_PROPERTY(muted, BOOL); RCT_EXPORT_VIEW_PROPERTY(volume, float); RCT_EXPORT_VIEW_PROPERTY(rate, float); - (NSDictionary *)constantsToExport { Loading
README.md +4 −4 Changes for README.md: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -51,10 +51,10 @@ Example code [here](https://github.com/brentvatne/react-native-login/blob/master playing videos from phone's camera - [x] Switch to AVPlayer (0.1.6) - [x] Switch resizeMode to prop instead of style (0.1.7) - [x] Add `pause` prop (0.1.7) - [ ] Add `playbackRate` prop - [ ] Add `volume` prop - [ ] Add `muted` prop - [x] Add `paused` prop (0.1.7) - [x] Add `rate` prop - [x] Add `volume` prop - [x] Add `muted` prop - [x] Add some way to get back the `currentTime` value (0.1.9 - `onProgress` prop) - [x] Add some way to get back the `duration` value (0.1.8 - `onLoad` prop) - [ ] Add some way to interface with `seekToTime` Loading
Video.ios.js +6 −2 Changes for Video.ios.js: 6 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -17,7 +17,10 @@ var Video = React.createClass({ style: StyleSheetPropType(VideoStylePropTypes), resizeMode: PropTypes.string, repeat: PropTypes.bool, pause: PropTypes.bool, paused: PropTypes.bool, muted: PropTypes.bool, volume: PropTypes.number, rate: PropTypes.number, onLoad: PropTypes.func, onProgress: PropTypes.func, }, Loading Loading @@ -66,7 +69,8 @@ var Video = React.createClass({ var RCTVideo = createReactIOSNativeComponentClass({ validAttributes: merge(ReactIOSViewAttributes.UIView, {src: true, resizeMode: true, repeat: true, pause: true}), {src: true, resizeMode: true, repeat: true, paused: true, muted: true, volume: true, rate: true}), uiViewClassName: 'RCTVideo', }); Loading
package.json +1 −1 Changes for package.json: 1 added line, 1 removed line. Original line number Diff line number Diff line { "name": "react-native-video", "version": "0.2.3", "version": "0.2.4", "description": "A <Video> element for react-native", "main": "Video.ios.js", "author": "Brent Vatne <brentvatne@gmail.com> (https://github.com/brentvatne)", Loading