Skip to content

Commit

Permalink
Merge pull request #410 from THEOplayer/release/v8.3.1
Browse files Browse the repository at this point in the history
Release/v8.3.1
  • Loading branch information
tvanlaerhoven authored Oct 7, 2024
2 parents b88ada4 + 4b23342 commit adc1bea
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 22 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/pr_android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build Android on PRs
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Run npm install
run: |
npm i -g corepack
npm ci
cd example
npm ci
- name: Build application
working-directory: example/android
run: ./gradlew assembleRelease

- name: Upload application
uses: actions/upload-artifact@v4
with:
name: app
path: example/android/app/build/outputs/apk/release/app-release.apk
retention-days: 3
49 changes: 49 additions & 0 deletions .github/workflows/pr_ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build iOS on PRs
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
strategy:
matrix:
xcode_version: [ '15.2' ]
runs-on: macos-14
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Select Xcode ${{ matrix.xcode_version }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode_version }} # Check versions: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Run npm install
run: |
npm i -g corepack
npm ci
cd example
npm ci
- name: Run pod install
working-directory: example/ios
run: |
pod install
- name: Start iOS simulator
uses: futureware-tech/simulator-action@v3
with:
model: 'iPhone 14'
os_version: '>=16.0'

- name: Build application
working-directory: example
run: npx react-native build-ios --mode Debug

32 changes: 32 additions & 0 deletions .github/workflows/pr_web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Web on PRs
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run npm install SDK
run: |
npm i -g corepack
npm ci
- name: Run npm install example
working-directory: example
run: npm ci

- name: Build Web example
working-directory: example
run: npm run web-release

- name: Save WEB to artifacts
uses: actions/upload-artifact@v4
with:
name: web-release
path: example/dist
retention-days: 3
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [8.3.1] - 24-10-07

### Fixed

- Fixed an issue on Android where on some Android SDK versions controlling playback with the notification buttons would not work.
- Fixed an issue on Web and Android where a text track with attribute `DEFAULT` was not set as the player's `selectedTextTrack` property.

## [8.3.0] - 24-09-30

### Added
Expand Down
10 changes: 10 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@
android:exported="false"
android:enabled="true"
android:foregroundServiceType="mediaPlayback">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</service>

<receiver android:name="androidx.media.session.MediaButtonReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>

</application>

</manifest>
16 changes: 0 additions & 16 deletions android/src/main/java/com/theoplayer/media/MediaPlaybackService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,9 @@ class MediaPlaybackService : Service() {
)
}

// Sets a pending intent for your media button receiver to allow restarting playback after
// the session has been stopped.
val mediaButtonPendingIntent = PendingIntent.getBroadcast(
this@MediaPlaybackService,
0,
Intent(
Intent.ACTION_MEDIA_BUTTON, null, applicationContext, MediaButtonReceiver::class.java
),
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
PendingIntent.FLAG_IMMUTABLE
} else {
PendingIntent.FLAG_ONE_SHOT
}
)

// Create and initialize the media session
val mediaSession = MediaSessionCompat(this, TAG).apply {
setSessionActivity(sessionActivityPendingIntent)
setMediaButtonReceiver(mediaButtonPendingIntent)
}

// Create a MediaSessionConnector.
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ react {
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
entryFile = file("../../index.ts")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-theoplayer",
"version": "8.3.0",
"version": "8.3.1",
"description": "A THEOplayer video component for react-native.",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
2 changes: 1 addition & 1 deletion src/internal/THEOplayerView.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function THEOplayerView(props: React.PropsWithChildren<THEOplayerViewProp
};
}, [container]);

const chromeless = config?.chromeless === undefined || config?.chromeless === true;
const chromeless = config?.chromeless === undefined || config?.chromeless;
return (
<>
<div
Expand Down
3 changes: 3 additions & 0 deletions src/internal/adapter/DefaultTextTrackState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export class DefaultTextTrackState implements TextTrackState {
case TrackListEventType.CHANGE_TRACK:
this._textTracks = removeTrack(this._textTracks, track);
this._textTracks = addTrack(this._textTracks, track);
if (event.track.mode === TextTrackMode.showing) {
this._selectedTextTrack = event.track.uid;
}
break;
}
};
Expand Down

0 comments on commit adc1bea

Please sign in to comment.