diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000000..e805ca0815 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,64 @@ +name: Bug report +description: Create a report to help us improve +title: "[BUG]: " +labels: ["bug"] +assignees: [] +body: + - type: markdown + attributes: + value: Thanks for taking the time to fill out this bug report! + + - type: dropdown + id: version + attributes: + label: Version + description: What version are you using? + options: + - v6 (Beta) + - v5 (Stable) + validations: + required: true + + - type: dropdown + id: platforms + attributes: + label: What platforms are you having the problem on? + multiple: true + options: + - iOS + - Android + - Windows + - visionOS + - Android TV + - Apple tvOS + + - type: dropdown + id: architecture + attributes: + label: Architecture + description: What architecture are you using? + options: + - Old architecture + - New architecture with interop layer + validations: + required: true + + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + placeholder: Tell us what you see! + value: "A bug happened!" + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: Reproduction + description: Tell us how can we reproduce this bug + placeholder: Reproduction + value: "Step to reproduce this bug are: " + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 61d5de719b..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -# Bug - - - -## Platform -Which player are you experiencing the problem on: -* iOS -* Android -* Windows - -## Environment info - - -Library version: x.x.x -Device: - -## Steps To Reproduce - - - -1. -2. -... - -## Expected behaviour - -1. -2. - -## Reproducible sample code - - - -## Video sample -If possible, include a link to the video that has the problem that can be streamed or downloaded from. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..3a9b3a4353 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: GitHub Discussions + url: https://github.com/react-native-video/react-native-video/discussions + about: Please ask and answer questions here. + - name: Slack Channel + url: https://join.slack.com/t/video-dev/shared_invite/zt-24kgmctuv-2z0O9J_v6q_rg~x1RujdOA + about: You can find us on the VideoDev Slack in the react-native-video channel. + - name: TheWidlarzGroup Discord + url: https://discord.gg/7Y6eE62hXM + about: Feel free to join our Discord server and ask questions there. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000000..371d1a9bd9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,52 @@ +name: Feature request +description: Suggest an idea for this project +title: "[Feature]: " +labels: ["feature"] +assignees: [] +body: + - type: markdown + attributes: + value: Thanks for taking the time to fill out this feature report! + + - type: textarea + id: description + attributes: + label: Description + description: Tell us your idea and why will concern if we implement it. You can also create a PR 😄 + placeholder: Tell us your idea! + value: "Very cool idea!" + validations: + required: true + + - type: textarea + id: why-it-is-needed + attributes: + label: Why it is needed ? + description: Tell us your why it is needed! + placeholder: Why it is needed ? + value: "Because it is cool!" + validations: + required: true + + - type: textarea + id: possible-implementation + attributes: + label: Possible implementation + description: | + Tell us your possible implementation! It really helps if you could describe from a technical POV how this new feature would work, which code it rely on, etc + placeholder: How to implement ? + value: "Technical POV how to do it" + validations: + required: false + + - type: textarea + id: code-sample + attributes: + label: Code sample + description: Please show how the new code could work, if doable + placeholder: Code sample + value: "Code sample" + validations: + required: false + + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index cc62df4e1d..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -# Feature Request - - - -## Why it is needed - - - -## Possible implementation - - - -### Code sample - - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5ee6f693c9..1781b9014d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,20 +1,25 @@ + +## Summary + +### Motivation + +### Changes + +## Test plan \ No newline at end of file diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index cf969a3476..9e9d485425 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -1,9 +1,10 @@ name: Build iOS on: + workflow_dispatch: push: branches: - - main + - master paths: - '.github/workflows/build-ios.yml' - 'ios/**' @@ -19,7 +20,7 @@ on: jobs: build: name: Build iOS Example App - runs-on: macOS-latest + runs-on: macos-14 # This allow us to use Xcode 15.0.1 which is a lot faster - TODO change to "macos-latest" once it's out of beta defaults: run: working-directory: examples/basic/ios @@ -62,13 +63,13 @@ jobs: -scheme videoplayer \ -sdk iphonesimulator \ -configuration Debug \ - -destination 'platform=iOS Simulator,name=iPhone 11 Pro' \ + -destination 'platform=iOS Simulator,name=iPhone 14' \ build \ CODE_SIGNING_ALLOWED=NO | xcpretty" build-with-ads: name: Build iOS Example App With Ads - runs-on: macOS-latest + runs-on: macos-14 # This allow us to use Xcode 15.0.1 which is a lot faster - TODO change to "macos-latest" once it's out of beta defaults: run: working-directory: examples/basic/ios @@ -111,13 +112,13 @@ jobs: -scheme videoplayer \ -sdk iphonesimulator \ -configuration Debug \ - -destination 'platform=iOS Simulator,name=iPhone 11 Pro' \ + -destination 'platform=iOS Simulator,name=iPhone 14' \ build \ CODE_SIGNING_ALLOWED=NO | xcpretty" build-with-caching: name: Build iOS Example App With Caching - runs-on: macOS-latest + runs-on: macos-14 # This allow us to use Xcode 15.0.1 which is a lot faster - TODO change to "macos-latest" once it's out of beta defaults: run: working-directory: examples/basic/ios @@ -160,6 +161,6 @@ jobs: -scheme videoplayer \ -sdk iphonesimulator \ -configuration Debug \ - -destination 'platform=iOS Simulator,name=iPhone 11 Pro' \ + -destination 'platform=iOS Simulator,name=iPhone 14' \ build \ CODE_SIGNING_ALLOWED=NO | xcpretty" \ No newline at end of file diff --git a/.github/workflows/check-ios.yml b/.github/workflows/check-ios.yml index 621522de7b..5becf7e7cf 100644 --- a/.github/workflows/check-ios.yml +++ b/.github/workflows/check-ios.yml @@ -24,7 +24,7 @@ jobs: env: WORKING_DIRECTORY: ios Swift-Format: - runs-on: macOS-latest + runs-on: macos-14 # This allow us to use Xcode 15.0.1 which is a lot faster - TODO change to "macos-latest" once it's out of beta defaults: run: working-directory: ./ios diff --git a/CHANGELOG.md b/CHANGELOG.md index 04c6960bee..f1b47d25eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ + + +# [6.0.0-beta.5](https://github.com/react-native-video/react-native-video/compare/v6.0.0-beta.4...v6.0.0-beta.5) (2024-02-02) + + +### Bug Fixes + +* **android:** fix crash with interop layer ([#3509](https://github.com/react-native-video/react-native-video/issues/3509)) ([41e9bcb](https://github.com/react-native-video/react-native-video/commit/41e9bcb1ef28c1532863186c83423814fcaf2372)) +* **android:** re-layout controls after fullscreen dismiss ([#3490](https://github.com/react-native-video/react-native-video/issues/3490)) ([135d97c](https://github.com/react-native-video/react-native-video/commit/135d97ce506bf1a0226042e0f29f4de5bcc10972)) +* fix typo ([#3497](https://github.com/react-native-video/react-native-video/issues/3497)) ([336eb44](https://github.com/react-native-video/react-native-video/commit/336eb44dc6061dad9cdc3382eb05d0a0effbef64)) +* **ios:** fix pip memory leak ([#3506](https://github.com/react-native-video/react-native-video/issues/3506)) ([53068dd](https://github.com/react-native-video/react-native-video/commit/53068ddd41218bb615cd129eba2c36d6347ccf25)) +* remove lifecycle listener after component unmount ([#3489](https://github.com/react-native-video/react-native-video/issues/3489)) ([3858a15](https://github.com/react-native-video/react-native-video/commit/3858a15b4268ae54d5b97c036d86b05aaf31bcf9)), closes [#3488](https://github.com/react-native-video/react-native-video/issues/3488) +* remove pausePlayback when audio focus loss event ([#3496](https://github.com/react-native-video/react-native-video/issues/3496)) ([b1ab0f2](https://github.com/react-native-video/react-native-video/commit/b1ab0f24a3efbcc3be49005060f50b34a117664e)) + + +### Features + +* implement onAudioTracks and onTextTracks on ios ([#3503](https://github.com/react-native-video/react-native-video/issues/3503)) ([6a49cba](https://github.com/react-native-video/react-native-video/commit/6a49cba273fa0a47e106f4abb8caeb4ab6dbe4c8)) + + +### Reverts + +* Revert "fix: remove pausePlayback when audio focus loss event (#3496)" (#3504) ([aec7db6](https://github.com/react-native-video/react-native-video/commit/aec7db63901c42dd7a591b030bfc69daa8860341)), closes [#3496](https://github.com/react-native-video/react-native-video/issues/3496) [#3504](https://github.com/react-native-video/react-native-video/issues/3504) + # [6.0.0-beta.4](https://github.com/react-native-video/react-native-video/compare/v6.0.0-beta.3...v6.0.0-beta.4) (2024-01-15) diff --git a/android/src/main/java/com/brentvatne/exoplayer/FullScreenPlayerView.java b/android/src/main/java/com/brentvatne/exoplayer/FullScreenPlayerView.java index 93080eaed3..f207ce8f5a 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/FullScreenPlayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/FullScreenPlayerView.java @@ -1,5 +1,6 @@ package com.brentvatne.exoplayer; +import android.annotation.SuppressLint; import android.app.Dialog; import android.content.Context; import android.view.ViewGroup; @@ -9,6 +10,7 @@ import androidx.activity.OnBackPressedCallback; import androidx.media3.ui.LegacyPlayerControlView; +@SuppressLint("PrivateResource") public class FullScreenPlayerView extends Dialog { private final LegacyPlayerControlView playerControlView; private final ExoPlayerView exoPlayerView; diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index f1b5e16723..4e0e8a9da3 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -1900,8 +1900,8 @@ public void setVolumeModifier(float volume) { public void seekTo(long positionMs) { if (player != null) { + seekTime = positionMs; player.seekTo(positionMs); - eventEmitter.seek(player.getCurrentPosition(), positionMs); } } diff --git a/android/src/main/res/values/styles.xml b/android/src/main/res/values/styles.xml index 3459d9d6e2..076e61efb6 100644 --- a/android/src/main/res/values/styles.xml +++ b/android/src/main/res/values/styles.xml @@ -1,6 +1,6 @@ - - diff --git a/docs/pages/component/methods.md b/docs/pages/component/methods.md index a03420c870..6d5aedc3b4 100644 --- a/docs/pages/component/methods.md +++ b/docs/pages/component/methods.md @@ -8,7 +8,7 @@ This page shows the list of available methods |[dismissFullscreenPlayer](#dismissfullscreenplayer) |Android, iOS | |[presentFullscreenPlayer](#presentfullscreenplayer) |Android, iOS | |[pause](#pause) |Android, iOS | -|[play](#play) |Android, iOS | +|[resume](#resume) |Android, iOS | |[save](#save) |iOS | |[restoreUserInterfaceForPictureInPictureStop](#restoreuserinterfaceforpictureinpicturestop)|iOS | |[seek](#seek) |All | @@ -39,10 +39,10 @@ Pause the video. Platforms: Android, iOS -### `play` -`play(): Promise` +### `resume` +`resume(): Promise` -Play the video. +Resume the video. Platforms: Android, iOS diff --git a/docs/pages/installation.md b/docs/pages/installation.md index 888be5f93d..8714ea3418 100644 --- a/docs/pages/installation.md +++ b/docs/pages/installation.md @@ -23,12 +23,6 @@ Then follow the instructions for your platform to link react-native-video into y ### Standard Method -### Enable Static Linking for dependencies in your ios project Podfile - -Add `use_frameworks! :linkage => :static` just under `platform :ios` in your ios project Podfile. - -[See the example ios project for reference](https://github.com/react-native-video/react-native-video/blob/9c669a2d8a53df36773fd82ff0917280d0659bc7/examples/basic/ios/Podfile#L31C38-L31C38) - ### Enable custom feature in podfile file Samples available in sample app see [sample pod file](https://github.com/react-native-video/react-native-video/blob/9c669a2d8a53df36773fd82ff0917280d0659bc7/examples/basic/ios/Podfile#L34) diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index 70ae6e81e5..6f4cf58141 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -199,8 +199,11 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH deinit { NotificationCenter.default.removeObserver(self) self.removePlayerLayer() - _pip = nil _playerObserver.clearPlayer() + + #if os(iOS) + _pip = nil + #endif } // MARK: - App lifecycle handlers @@ -1360,7 +1363,8 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH #endif if _repeat { let item: AVPlayerItem! = notification.object as? AVPlayerItem - item.seek(to: CMTime.zero, completionHandler: nil) + + item.seek(to: _source?.cropStart != nil ? CMTime(value: _source!.cropStart!, timescale: 1000) : CMTime.zero, completionHandler: nil) self.applyModifiers() } else { self.setPaused(true) diff --git a/package.json b/package.json index 9d2dad3279..196b9b433d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-video", - "version": "6.0.0-beta.4", + "version": "6.0.0-beta.5", "description": "A