Skip to content

Commit

Permalink
Merge pull request #20 from THEOplayer/release/v0.5.0
Browse files Browse the repository at this point in the history
Release/v0.5.0
  • Loading branch information
Jeroen-Veltmans authored Mar 6, 2024
2 parents c76ff76 + 332c665 commit 0adf0fc
Show file tree
Hide file tree
Showing 24 changed files with 763 additions and 76 deletions.
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,10 @@
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
},
"settings": {
"react": {
"version": "detect"
}
}
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ 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.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.5.0] - 24-03-06

### Added

- Added support for CSAI.

### Fixed

- Fixed connected state for chromecastButton to not take into account the casting state in general (e.g. airplay should not influence this state).

## [0.4.0] - 24-02-14

### Added
Expand Down
36 changes: 34 additions & 2 deletions example/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import {useState} from 'react';
import {
AdClickThroughButton,
CenteredControlBar,
CenteredDelayedActivityIndicator,
ControlBar,
Expand All @@ -12,6 +13,7 @@ import {
PlaybackRateSubMenu,
PlayButton,
QualitySubMenu,
SeekBar,
SettingsMenuButton,
SkipButton,
Spacer,
Expand All @@ -26,6 +28,9 @@ import {
} from 'react-native-theoplayer';

import {Platform, StyleSheet, View, ViewStyle} from 'react-native';
import {AdDisplay} from '../src/ui/components/ads/AdDisplay';
import {AdCountdown} from '../src/ui/components/ads/AdCountdown';
import {AdSkipButton} from '../src/ui/components/ads/AdSkipButton';

const playerConfig: PlayerConfiguration = {
// Get your THEOplayer license from https://portal.theoplayer.com/
Expand Down Expand Up @@ -114,8 +119,9 @@ export default function App() {
}
bottom={
<>
<ControlBar style={{justifyContent: 'flex-start'}} />
<ControlBar />
<ControlBar>
<SeekBar />
</ControlBar>
<ControlBar>
<MuteButton />
<TimeLabel showDuration={true} />
Expand All @@ -125,6 +131,32 @@ export default function App() {
</ControlBar>
</>
}
adTop={
<>
<ControlBar>
<AdClickThroughButton />
</ControlBar>
</>
}
adCenter={
<>
<CenteredControlBar middle={<PlayButton />} />
</>
}
adBottom={
<>
<ControlBar style={{justifyContent: 'flex-start'}}>
<AdDisplay />
<AdCountdown />
<Spacer />
<AdSkipButton />
</ControlBar>
<ControlBar>
<MuteButton />
<SeekBar />
</ControlBar>
</>
}
/>
)}
</THEOplayerView>
Expand Down
1 change: 1 addition & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ hermesEnabled=true

# Enable THEOplayer Extensions (default: disabled)
THEOplayer_extensionGoogleIMA = true
THEOplayer_extensionGoogleDAI = true
18 changes: 9 additions & 9 deletions example/package-lock.json

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

3 changes: 2 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"react-native": "0.72.7",
"react-native-google-cast": "^4.6.2",
"react-native-svg": "^14.0.0",
"react-native-theoplayer": "^3.1.0",
"react-native-theoplayer": "^3.8.0",
"react-native-web": "^0.19.9",
"react-native-web-image-loader": "^0.1.1"
},
Expand All @@ -43,6 +43,7 @@
"node-polyfill-webpack-plugin": "^2.0.1",
"prettier": "^2.4.1",
"react-test-renderer": "18.2.0",
"theoplayer": "^6.9.0",
"typescript": "4.8.4",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
Expand Down
27 changes: 27 additions & 0 deletions example/web/public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,30 @@ body {
.theoplayer-container {
z-index: 0;
}

/*
* Hack: THEOplayer's own linear ad UI is not positioned correctly by default
* when using the chromeless player.
*/
.theoplayer-ad-linear {
position: absolute;
inset: 0;
z-index: 10;
}

/*
* Hack: hide THEOplayer's built-in ad UI, so we can use our own components instead
* such as <AdCountdown /> and <AdSkipButton />.
*/
.theo-ad-remaining-container,
.theoplayer-ad-skip,
.theoplayer-ad-touch-clickthrough {
display: none !important;
}

/*
* Hack: hide overflow so that when google ima is enabled the screen won't shake furiously anymore.
*/
.theoplayer-container {
overflow-y: hidden;
}
29 changes: 12 additions & 17 deletions package-lock.json

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

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@theoplayer/react-native-ui",
"version": "0.4.0",
"version": "0.5.0",
"description": "A React Native UI for @theoplayer/react-native",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -57,9 +57,9 @@
"react-native-builder-bob": "^0.18.0",
"react-native-google-cast": "^4.6.2",
"react-native-svg": "^13.8.0",
"react-native-theoplayer": "^2.7.0",
"react-native-theoplayer": "^3.8.0",
"release-it": "^16.2.0",
"theoplayer": "^6.5.0",
"theoplayer": "^6.9.0",
"typescript": "^4.1.3"
},
"peerDependencies": {
Expand All @@ -68,6 +68,7 @@
"react-native": "*",
"react-native-google-cast": "^4.6.2",
"react-native-svg": "^13.8.0",
"react-native-theoplayer": ">=2.7.0",
"theoplayer": ">=5.0.1"
},
"peerDependenciesMeta": {
Expand Down
33 changes: 31 additions & 2 deletions src/ui/THEOplayerDefaultUi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ import { MuteButton } from './components/button/MuteButton';
import { CastMessage } from './components/message/CastMessage';
import { DEFAULT_THEOPLAYER_THEME, THEOplayerTheme } from './THEOplayerTheme';
import { Platform, StyleProp, View, ViewStyle } from 'react-native';
import { UiContainer } from './components/uicontroller/UiContainer';
import { FULLSCREEN_CENTER_STYLE, UiContainer } from './components/uicontroller/UiContainer';
import { PlayButton } from './components/button/PlayButton';
import { SkipButton } from './components/button/SkipButton';
import { Spacer } from './components/controlbar/Spacer';
import { ChromecastButton } from './components/button/ChromecastButton';
import { CenteredDelayedActivityIndicator } from './components/activityindicator/CenteredDelayedActivityIndicator';
import { FULLSCREEN_CENTER_STYLE } from './components/uicontroller/UiContainer';
import { AdDisplay } from './components/ads/AdDisplay';
import { AdCountdown } from './components/ads/AdCountdown';
import { AdSkipButton } from './components/ads/AdSkipButton';
import { AdClickThroughButton } from './components/ads/AdClickThroughButton';

export interface THEOplayerDefaultUiProps {
/**
Expand Down Expand Up @@ -101,6 +104,32 @@ export function THEOplayerDefaultUi(props: THEOplayerDefaultUiProps) {
</ControlBar>
</>
}
adTop={
<>
<ControlBar>
<AdClickThroughButton />
</ControlBar>
</>
}
adCenter={
<>
<CenteredControlBar middle={<PlayButton />} />
</>
}
adBottom={
<>
<ControlBar style={{ justifyContent: 'flex-start' }}>
<AdDisplay />
<AdCountdown />
<Spacer />
<AdSkipButton />
</ControlBar>
<ControlBar>
<MuteButton />
<SeekBar />
</ControlBar>
</>
}
/>
)}
</THEOplayerView>
Expand Down
15 changes: 15 additions & 0 deletions src/ui/THEOplayerTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ export interface ColorTheme {
* The color of the dot on the seek bar.
*/
seekBarDot: string;
/**
* The color of the ad display text
*/
adDiplayText: string;
/**
* The color of the ad display background.
*/
adDisplayBackground: string;
/**
* The color of the ad skip button background.
*/
adSkipBackground: string;
}

/**
Expand Down Expand Up @@ -97,6 +109,9 @@ export const DEFAULT_THEOPLAYER_THEME: THEOplayerTheme = {
seekBarMinimum: '#FFFFFF',
seekBarMaximum: '#FFFFFF50',
seekBarDot: '#FFFFFF',
adDiplayText: '#000',
adDisplayBackground: '#FFC50F',
adSkipBackground: '#00000070',
},
text: {
textAlignVertical: 'center',
Expand Down
Loading

0 comments on commit 0adf0fc

Please sign in to comment.