Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: bump #picture-in-picture to 6.0.0-alpha.7 #7

Merged
merged 9 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ Video with caching ([more info](docs/caching.md)):
end
```

#### Enable custom feature in podfile file

##### Google IMA

Google IMA is the google SDK to support Client Side Ads Integration (CSAI), see [google documentation](https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side) for more informations.

To enable google IMA usage define add following line in your podfile:
```podfile
$RNVideoUseGoogleIMA=true
```

</details>

### tvOS installation
Expand Down Expand Up @@ -320,6 +331,7 @@ var styles = StyleSheet.create({
| [selectedAudioTrack](#selectedaudiotrack) | Android, iOS |
| [selectedTextTrack](#selectedtexttrack) | Android, iOS |
| [selectedVideoTrack](#selectedvideotrack) | Android |
| [shutterColor](#shutterColor) | Android |
| [source](#source) | All |
| [subtitleStyle](#subtitleStyle) | Android |
| [textTracks](#texttracks) | Android, iOS |
Expand Down Expand Up @@ -841,6 +853,17 @@ If a track matching the specified Type (and Value if appropriate) is unavailable

Platforms: Android

#### shutterColor
Apply color to shutter view, if you see black flashes before video start then set

```
shutterColor='transparent'
```

- black (default)

Platforms: Android

#### source
Sets the media source. You can pass an asset loaded via require or an object with a uri.

Expand Down Expand Up @@ -916,6 +939,21 @@ The following other types are supported on some platforms, but aren't fully docu
`content://, ms-appx://, ms-appdata://, assets-library://`


##### Playing only a portion of the video (start & end time)

Provide an optional `startTime` and/or `endTime` for the video. Value is in milliseconds. Useful when you want to play only a portion of a large video.

Example
```
source={{ uri: 'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8', startTime: 36012, endTime: 48500 }}

source={{ uri: 'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8', startTime: 36012 }}

source={{ uri: 'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8', endTime: 48500 }}
```

Platforms: iOS, Android

#### subtitleStyle

Property | Description | Platforms
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
## Changelog

### Version 6.0.0-alpha.7
- All: clean JS warnings (https://github.com/react-native-video/react-native-video/pull/3183)
- Android: Add shutterView color configurtion (https://github.com/react-native-video/react-native-video/pull/3179)
- Android: React native 0.73 support (https://github.com/react-native-video/react-native-video/pull/3163)
- Android: Fix memory leaks from AudioManager [#3123](https://github.com/react-native-video/react-native-video/pull/3123)
- Android: Fixed syntax error [#3182](https://github.com/react-native-video/react-native-video/issues/3182)
- iOS: Fix freeze at playback startup (https://github.com/react-native-video/react-native-video/pull/3173)
- iOS: Various safety checks (https://github.com/react-native-video/react-native-video/pull/3168)

### Version 6.0.0-alpha.6
- Feature: Video range support [#3030](https://github.com/react-native-video/react-native-video/pull/3030)
- iOS: remove undocumented `currentTime` property [#3064](https://github.com/react-native-video/react-native-video/pull/3064)
- iOS: make sure that the audio in ads is muted when the player is muted. [#3068](https://github.com/react-native-video/react-native-video/pull/3077)
- iOS: make IMA build optionnal

### Version 6.0.0-alpha.5

- iOS: ensure controls are not displayed when disabled by user [#3017](https://github.com/react-native-video/react-native-video/pull/3017)
Expand Down
37 changes: 10 additions & 27 deletions Video.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ImagePropTypes, ViewPropTypes } from 'deprecated-react-native-prop-types';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { findNodeHandle, Image, NativeModules, Platform, requireNativeComponent, StyleSheet, UIManager, View } from 'react-native';
import PropTypes from 'prop-types';
import { StyleSheet, requireNativeComponent, NativeModules, UIManager, View, Image, Platform, findNodeHandle } from 'react-native';
import { ViewPropTypes, ImagePropTypes } from 'deprecated-react-native-prop-types';
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
import DRMType from './DRMType';
import FilterType from './FilterType';
import TextTrackType from './TextTrackType';
import FilterType from './FilterType';
import DRMType from './DRMType';
import VideoResizeMode from './VideoResizeMode.js';

const styles = StyleSheet.create({
Expand All @@ -14,8 +14,8 @@
},
});

const { VideoDecoderProperties } = NativeModules

Check warning on line 17 in Video.js

View workflow job for this annotation

GitHub Actions / build

Missing semicolon

Check warning on line 17 in Video.js

View workflow job for this annotation

GitHub Actions / build

Missing semicolon
export { TextTrackType, FilterType, DRMType, VideoDecoderProperties };
export { TextTrackType, FilterType, DRMType, VideoDecoderProperties }

Check warning on line 18 in Video.js

View workflow job for this annotation

GitHub Actions / build

Missing semicolon

Check warning on line 18 in Video.js

View workflow job for this annotation

GitHub Actions / build

Missing semicolon

export default class Video extends Component {

Expand Down Expand Up @@ -348,6 +348,8 @@
mainVer: source.mainVer || 0,
patchVer: source.patchVer || 0,
requestHeaders: source.headers ? this.stringsOnlyObject(source.headers) : {},
startTime: source.startTime || 0,
endTime: source.endTime

Check warning on line 352 in Video.js

View workflow job for this annotation

GitHub Actions / build

Missing trailing comma

Check warning on line 352 in Video.js

View workflow job for this annotation

GitHub Actions / build

Missing trailing comma
},
onVideoLoadStart: this._onLoadStart,
onVideoPlaybackStateChanged: this._onPlaybackStateChanged,
Expand Down Expand Up @@ -421,13 +423,6 @@
FilterType.SEPIA,
]),
filterEnabled: PropTypes.bool,
/* Native only */
src: PropTypes.object,
seek: PropTypes.oneOfType([
PropTypes.number,
PropTypes.object,
]),
fullscreen: PropTypes.bool,
onVideoLoadStart: PropTypes.func,
onVideoLoad: PropTypes.func,
onVideoBuffer: PropTypes.func,
Expand Down Expand Up @@ -527,7 +522,6 @@
disableBuffering: PropTypes.bool,
controls: PropTypes.bool,
audioOnly: PropTypes.bool,
currentTime: PropTypes.number,
fullscreenAutorotate: PropTypes.bool,
fullscreenOrientation: PropTypes.oneOf(['all', 'landscape', 'portrait']),
progressUpdateInterval: PropTypes.number,
Expand All @@ -541,6 +535,7 @@
useTextureView: PropTypes.bool,
useSecureView: PropTypes.bool,
hideShutterView: PropTypes.bool,
shutterColor: PropTypes.string,
onLoadStart: PropTypes.func,
onPlaybackStateChanged: PropTypes.func,
onLoad: PropTypes.func,
Expand All @@ -565,24 +560,12 @@
onAudioFocusChanged: PropTypes.func,
onAudioBecomingNoisy: PropTypes.func,
onPictureInPictureStatusChanged: PropTypes.func,
needsToRestoreUserInterfaceForPictureInPictureStop: PropTypes.func,
onExternalPlaybackChange: PropTypes.func,
adTagUrl: PropTypes.string,
onReceiveAdEvent: PropTypes.func,

/* Required by react-native */
scaleX: PropTypes.number,
scaleY: PropTypes.number,
translateX: PropTypes.number,
translateY: PropTypes.number,
rotation: PropTypes.number,
...ViewPropTypes,
};

const RCTVideo = requireNativeComponent('RCTVideo', Video, {
nativeOnly: {
src: true,
seek: true,
fullscreen: true,
},
});
const RCTVideo = requireNativeComponent('RCTVideo');
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def configStringPath = (
).md5()

android {
namespace 'com.brentvatne.react'
compileSdkVersion safeExtGet('compileSdkVersion', 31)
buildToolsVersion safeExtGet('buildToolsVersion', '30.0.2')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ public void setSubtitleStyle(SubtitleStyle style) {
subtitleLayout.setPadding(style.getPaddingLeft(), style.getPaddingTop(), style.getPaddingRight(), style.getPaddingBottom());
}

public void setShutterColor(Integer color) {
shutterView.setBackgroundColor(color);
}

private void updateSurfaceView() {
View view;
if (!useTextureView || useSecureView) {
Expand Down
Loading
Loading