Skip to content

Commit

Permalink
Merge branch 'development' into update_android_player_to_3.57.1+jason
Browse files Browse the repository at this point in the history
rolandkakonyi committed Jan 26, 2024
2 parents 24c5c83 + 754460f commit 0e07a0c
Showing 15 changed files with 92 additions and 161 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/create-sdk-update-pr.yml
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ jobs:
cache: 'yarn'

- name: Restore Pods cache
if: ${{ inputs.sdk_name == 'ios' }}
id: pods-cache-restore
uses: actions/cache/restore@v3
with:
@@ -71,7 +72,7 @@ jobs:
yarn bootstrap
- name: Save Pods cache
if: steps.pods-cache-restore.outputs.cache-hit != 'true'
if: ${{ inputs.sdk_name == 'ios' && steps.pods-cache-restore.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v3
with:
path: |
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [Unreleased]

### Added

- Support for side-loaded SRT (SubRip) subtitles

### Changed

- Update Bitmovin's native iOS SDK version to `3.55.0`

### Fixed

- Remove `patch-package` usage from released product

## [0.16.0] (2024-01-17)

### Changed
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,9 @@

This is an open-source project created to enable customers to integrate the Bitmovin mobile Player SDKs into React Native projects. It has been created to provide customers with a starting point, which can be built upon through active collaboration and contributions. We look forward to seeing this library expand and grow.

[![Build](https://github.com/bitmovin/bitmovin-player-react-native/actions/workflows/ci.yml/badge.svg)](https://github.com/bitmovin/bitmovin-player-react-native/actions/workflows/ci.yml)
[![CI (TypeScript)](https://github.com/bitmovin/bitmovin-player-react-native/actions/workflows/ci-typescript.yml/badge.svg)](https://github.com/bitmovin/bitmovin-player-react-native/actions/workflows/ci-typescript.yml)
[![CI (Android)](https://github.com/bitmovin/bitmovin-player-react-native/actions/workflows/ci-android.yml/badge.svg)](https://github.com/bitmovin/bitmovin-player-react-native/actions/workflows/ci-android.yml)
[![CI (iOS & tvOS)](https://github.com/bitmovin/bitmovin-player-react-native/actions/workflows/ci-ios-tvos.yml/badge.svg)](https://github.com/bitmovin/bitmovin-player-react-native/actions/workflows/ci-ios-tvos.yml)
![Platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20tvOS%20%7C%20Android%20%7C%20Android%20TV-lightgrey.svg)
[![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
[![Bitmovin Community](https://img.shields.io/discourse/users?label=community&server=https%3A%2F%2Fcommunity.bitmovin.com)](https://community.bitmovin.com/?utm_source=github&utm_medium=bitmovin-player-react-native&utm_campaign=dev-community)
2 changes: 1 addition & 1 deletion RNBitmovinPlayer.podspec
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,mm,swift}"

s.dependency "React-Core"
s.dependency "BitmovinPlayer", "3.54.0"
s.dependency "BitmovinPlayer", "3.55.0"
s.ios.dependency "GoogleAds-IMA-iOS-SDK", "3.18.4"
s.tvos.dependency "GoogleAds-IMA-tvOS-SDK", "4.8.2"
end
Original file line number Diff line number Diff line change
@@ -530,7 +530,11 @@ fun ReadableMap.toSubtitleTrack(): SubtitleTrack? {
/**
* Converts any subtitle format name in its mime type representation.
*/
private fun String.toSubtitleMimeType(): String = "text/$this"
private fun String.toSubtitleMimeType(): String = when (this) {
"srt" -> "application/x-subrip"
"ttml" -> "application/ttml+xml"
else -> "text/$this"
}

/**
* Converts any `SubtitleTrack` into its json representation.
24 changes: 12 additions & 12 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
PODS:
- BitmovinAnalyticsCollector/BitmovinPlayer (3.4.0):
- BitmovinAnalyticsCollector/BitmovinPlayer (3.5.0):
- BitmovinAnalyticsCollector/Core
- BitmovinPlayerCore (~> 3.48)
- BitmovinAnalyticsCollector/Core (3.4.0)
- BitmovinPlayer (3.54.0):
- BitmovinAnalyticsCollector/Core (3.5.0)
- BitmovinPlayer (3.55.0):
- BitmovinAnalyticsCollector/BitmovinPlayer (~> 3.0)
- BitmovinPlayerCore (= 3.54.0)
- BitmovinPlayerCore (3.54.0)
- BitmovinPlayerCore (= 3.55.0)
- BitmovinPlayerCore (3.55.0)
- boost (1.76.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.72.6-1)
@@ -424,7 +424,7 @@ PODS:
- React-logger (= 0.72.6-1)
- React-perflogger (= 0.72.6-1)
- RNBitmovinPlayer (0.16.0):
- BitmovinPlayer (= 3.54.0)
- BitmovinPlayer (= 3.55.0)
- GoogleAds-IMA-iOS-SDK (= 3.18.4)
- GoogleAds-IMA-tvOS-SDK (= 4.8.2)
- React-Core
@@ -591,10 +591,10 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
BitmovinAnalyticsCollector: cd3a393e831fba539ea88a37ba164cca0c03f180
BitmovinPlayer: 9d558199a0a8b7e93c978cad22c0a6b23f28720a
BitmovinPlayerCore: 601f922a42485833d2991f4d6ebfd494ea2a26af
boost: 0ed1b9a58a27b2f7885dc9f279bc3b341f44512b
BitmovinAnalyticsCollector: 8b9a4b07f1fa2a43996ba29598eab6f50a25edfe
BitmovinPlayer: 4c42de316c9f56552fcde5cf20701329f55cc0db
BitmovinPlayerCore: 6699939e9c37b6047c3afc224245f01c60089ead
boost: 43f331345fd5d44b60bf621e7e579ae7b8fda687
DoubleConversion: 234abba95e31cc2aada0cf3b97cdb11bc5b90575
FBLazyVector: 58c22987e2cd1eebb2e3bc9f7756d87b14c32d3c
FBReactNativeSpec: 1e59b7675304d2b0fd3e9c208cb88b97143ff314
@@ -639,12 +639,12 @@ SPEC CHECKSUMS:
React-runtimescheduler: acd6b708338a975a9bb4c594eac0f018f5c15fa3
React-utils: c1cf85c0cd58c11dfb95104a78c608e95d03eb9e
ReactCommon: 1dabb8f37c44d8c7370238bd8f504cbad0cfd941
RNBitmovinPlayer: af321b0df6e717e09408f4bf083d8132ea543d07
RNBitmovinPlayer: 765aa1ba9d469e5be9c65fdd9f8f41a68ee40c53
RNCPicker: 529d564911e93598cc399b56cc0769ce3675f8c8
RNScreens: 4a1af06327774490d97342c00aee0c2bafb497b7
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: f67f5769ce78049c5fe798bc735f04535c7bc1ac

PODFILE CHECKSUM: 9bcb40f1d3c1dd409afb56a91db20d32f4c8f9bd

COCOAPODS: 1.14.2
COCOAPODS: 1.14.3
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@
"ios": "react-native run-ios",
"start": "react-native start",
"pods": "yarn pods-install || yarn pods-update",
"pods-install": "yarn pod-install",
"pods-update": "pod update --silent"
"pods-install": "NO_FLIPPER=1 yarn pod-install",
"pods-update": "NO_FLIPPER=1 pod update --silent"
},
"dependencies": {
"@react-native-picker/picker": "2.5.1",
11 changes: 9 additions & 2 deletions example/src/screens/SubtitlePlayback.tsx
Original file line number Diff line number Diff line change
@@ -34,13 +34,20 @@ export default function SubtitlePlayback() {
poster: 'https://bitmovin-a.akamaihd.net/content/sintel/poster.png',
// External subtitle tracks to be added to the source.
subtitleTracks: [
// Add custom english subtitles. You can select 'Custom English' in the subtitles menu.
// Add custom english subtitles. You can select 'Custom English (WebVTT)' in the subtitles menu.
{
url: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.vtt',
label: 'Custom English',
label: 'Custom English (WebVTT)',
language: 'en',
format: SubtitleFormat.VTT,
},
// Add custom english subtitles. You can select 'Custom English (SRT)' in the subtitles menu.
{
url: 'https://bitdash-a.akamaihd.net/content/sintel/subtitles/subtitles_en.srt',
label: 'Custom English (SRT)',
language: 'en',
format: SubtitleFormat.SRT,
},
],
});
return () => {
24 changes: 12 additions & 12 deletions integration_test/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
PODS:
- BitmovinAnalyticsCollector/BitmovinPlayer (3.4.0):
- BitmovinAnalyticsCollector/BitmovinPlayer (3.5.0):
- BitmovinAnalyticsCollector/Core
- BitmovinPlayerCore (~> 3.48)
- BitmovinAnalyticsCollector/Core (3.4.0)
- BitmovinPlayer (3.54.0):
- BitmovinAnalyticsCollector/Core (3.5.0)
- BitmovinPlayer (3.55.0):
- BitmovinAnalyticsCollector/BitmovinPlayer (~> 3.0)
- BitmovinPlayerCore (= 3.54.0)
- BitmovinPlayerCore (3.54.0)
- BitmovinPlayerCore (= 3.55.0)
- BitmovinPlayerCore (3.55.0)
- boost (1.76.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.72.6-1)
@@ -413,7 +413,7 @@ PODS:
- React-logger (= 0.72.6-1)
- React-perflogger (= 0.72.6-1)
- RNBitmovinPlayer (0.16.0):
- BitmovinPlayer (= 3.54.0)
- BitmovinPlayer (= 3.55.0)
- GoogleAds-IMA-iOS-SDK (= 3.18.4)
- GoogleAds-IMA-tvOS-SDK (= 4.8.2)
- React-Core
@@ -559,10 +559,10 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
BitmovinAnalyticsCollector: cd3a393e831fba539ea88a37ba164cca0c03f180
BitmovinPlayer: 9d558199a0a8b7e93c978cad22c0a6b23f28720a
BitmovinPlayerCore: 601f922a42485833d2991f4d6ebfd494ea2a26af
boost: 0ed1b9a58a27b2f7885dc9f279bc3b341f44512b
BitmovinAnalyticsCollector: 8b9a4b07f1fa2a43996ba29598eab6f50a25edfe
BitmovinPlayer: 4c42de316c9f56552fcde5cf20701329f55cc0db
BitmovinPlayerCore: 6699939e9c37b6047c3afc224245f01c60089ead
boost: 43f331345fd5d44b60bf621e7e579ae7b8fda687
DoubleConversion: 234abba95e31cc2aada0cf3b97cdb11bc5b90575
FBLazyVector: 58c22987e2cd1eebb2e3bc9f7756d87b14c32d3c
FBReactNativeSpec: 1e59b7675304d2b0fd3e9c208cb88b97143ff314
@@ -602,10 +602,10 @@ SPEC CHECKSUMS:
React-runtimescheduler: acd6b708338a975a9bb4c594eac0f018f5c15fa3
React-utils: c1cf85c0cd58c11dfb95104a78c608e95d03eb9e
ReactCommon: 1dabb8f37c44d8c7370238bd8f504cbad0cfd941
RNBitmovinPlayer: af321b0df6e717e09408f4bf083d8132ea543d07
RNBitmovinPlayer: 765aa1ba9d469e5be9c65fdd9f8f41a68ee40c53
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: f67f5769ce78049c5fe798bc735f04535c7bc1ac

PODFILE CHECKSUM: d0a62a1438d35d60f8a37ab38f3c92b4125f720f

COCOAPODS: 1.14.2
COCOAPODS: 1.14.3
4 changes: 2 additions & 2 deletions integration_test/package.json
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@
"test:android": "yarn stop-test:android && yarn start-test:android",
"test:ios": "yarn stop-test:ios && yarn start-test:ios",
"pods": "yarn pods-install || yarn pods-update",
"pods-install": "yarn pod-install",
"pods-update": "pod update --silent"
"pods-install": "NO_FLIPPER=1 yarn pod-install",
"pods-update": "NO_FLIPPER=1 pod update --silent"
},
"dependencies": {
"cavy": "^4.0.2",
4 changes: 4 additions & 0 deletions ios/RCTConvert+BitmovinPlayer.swift
Original file line number Diff line number Diff line change
@@ -553,6 +553,8 @@ extension RCTConvert {
return .webVtt
case "ttml":
return .ttml
case "srt":
return .srt
default:
return nil
}
@@ -582,6 +584,8 @@ extension RCTConvert {
return "vtt"
case .ttml:
return "ttml"
case .srt:
return "srt"
}
}(),
]
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -37,11 +37,10 @@
"integration-test": "yarn --cwd integration_test",
"pods": "yarn example pods && yarn integration-test pods",
"bootstrap": "yarn bootstrap:example && yarn bootstrap:integration-test",
"bootstrap:example": "yarn && patch-package && yarn example && yarn example pods && yarn brew",
"bootstrap:integration-test": "yarn && patch-package && yarn integration-test && yarn integration-test pods && yarn brew",
"bootstrap:example": "yarn && yarn example && yarn example pods && yarn brew",
"bootstrap:integration-test": "yarn && yarn integration-test && yarn integration-test pods && yarn brew",
"brew": "[ \"$(uname)\" = \"Darwin\" ] && brew bundle install --no-lock",
"prepare": "husky install",
"postinstall": "patch-package",
"docs": "typedoc"
},
"keywords": [
@@ -76,7 +75,6 @@
"lint-staged": "13.0.3",
"metro-config": "0.72.3",
"metro-react-native-babel-preset": "0.72.3",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"prettier": "2.7.1",
"react": "18.2.0",
15 changes: 0 additions & 15 deletions patches/react-native+0.72.6.patch

This file was deleted.

20 changes: 19 additions & 1 deletion src/subtitleTrack.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
/**
* Supported subtitle/caption file formats.
* @platform Android, iOS, tvOS
*/
export enum SubtitleFormat {
/**
* Closed Captioning (CEA) subtitle format.
* @platform Android, iOS, tvOS
*/
CEA = 'cea',
/**
* Timed Text Markup Language (TTML) subtitle format.
* @platform Android, iOS, tvOS
*/
TTML = 'ttml',
/**
* Web Video Text Tracks Format (WebVTT) subtitle format.
* @platform Android, iOS, tvOS
*/
VTT = 'vtt',
/**
* SubRip (SRT) subtitle format.
* @platform Android, iOS, tvOS
*/
SRT = 'srt',
}

/**
* Describes a subtitle track.
* @platform Android, iOS, tvOS
*/
export interface SubtitleTrack {
/**
@@ -47,7 +66,6 @@ export interface SubtitleTrack {

/**
* A subtitle track that can be added to `SourceConfig.subtitleTracks`.
*
*/
export interface SideLoadedSubtitleTrack extends SubtitleTrack {
url: string;
Loading

0 comments on commit 0e07a0c

Please sign in to comment.