-
Notifications
You must be signed in to change notification settings - Fork 3
feat(PLAY-324): upgrade @flowplayer/player to latest canary, fix opts prop types #46
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8fac0b0
chore: upgrade @flowplayer/player to 3.10.4-rc.1
maximzavadskiy 21d4251
chore: dangerously stub Plugin tab
maximzavadskiy a1117dd
chore: upgrade to 3.10.4-rc.2, use Plugin type
maximzavadskiy 8e768fd
chore: upgrade to 3.10.4-rc.4
maximzavadskiy 4f06b75
fix: opts prop types
maximzavadskiy f033636
chore: add typespec tests
maximzavadskiy 1864436
fix: peerDependency
maximzavadskiy 9ac88af
chore: bump circleci image to node:20.12
maximzavadskiy a43dc7b
chore: add typespec to Github Actions
maximzavadskiy d632497
chore: use node orb in Circle CI
maximzavadskiy 123d733
chore: use cimg/base:stable docker image
maximzavadskiy 9932842
chore: use default orb yarn install
maximzavadskiy 0a69c5e
fix: github workflow folder
maximzavadskiy 6aee42f
refactor: remove unused imports and format code
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: test | ||
| # Triggers the workflow on push or pull request events | ||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| danger-bot: | ||
| runs-on: ubuntu-latest | ||
| name: run typespec | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18 | ||
| - name: Find yarn cache | ||
| id: yarn-cache-path | ||
| run: echo "::set-output name=dir::$(yarn cache dir)" | ||
| - name: Restore cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.yarn-cache-path.outputs.dir }} | ||
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-yarn- | ||
| - name: Authenticate with private NPM package | ||
| run: echo "//registry.npmjs.org/:_authToken=${{ secrets.PLAYBACK_NPM_PUBLISHING_TOKEN }}" > ~/.npmrc | ||
| - name: yarn install | ||
| run: yarn install --immutable | ||
| - name: build | ||
| run: yarn build | ||
| - name: test typespec | ||
| run: yarn test:dts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import { expectType, expectError } from "tsd"; | ||
| import Flowplayer, { useFlowplayer } from "../lib"; | ||
| import React, { useRef } from "react"; | ||
| import { Player } from "@flowplayer/player"; | ||
|
|
||
| // - useFlowplayer returns Player instance - | ||
| const playerRef = useRef<HTMLDivElement>(null); | ||
| const playerApi = useFlowplayer(playerRef); | ||
| expectType<Player | null>(playerApi); | ||
|
|
||
| // - basic initalization - | ||
| const _uplayer = ( | ||
| <Flowplayer src={"demoSrc"} token={"DEMO_TOKEN"} ref={playerRef} /> | ||
| ); | ||
|
|
||
| // - missing src throws err - | ||
| expectError(<Flowplayer token={"DEMO_TOKEN"} ref={playerRef} />); | ||
|
|
||
| // - opts basic - | ||
| const _uplayerWithOpts = ( | ||
| <Flowplayer | ||
| src={"demoSrc"} | ||
| token={"DEMO_TOKEN"} | ||
| ref={playerRef} | ||
| opts={{ | ||
| title: "Example title", | ||
| description: "Example description", | ||
| autopause: true, | ||
| }} | ||
| /> | ||
| ); | ||
|
|
||
| // - opts with plugins - | ||
| const _uplayerWithPlugins = ( | ||
| <Flowplayer | ||
| src={"demoSrc"} | ||
| token={"DEMO_TOKEN"} | ||
| ref={playerRef} | ||
| opts={{ | ||
| title: "Example title", | ||
| description: "Example description", | ||
| cueponts: [ | ||
| { | ||
| startTime: 1, | ||
| endTime: 2, | ||
| text: "df", | ||
| }, | ||
| ], | ||
| }} | ||
| /> | ||
| ); | ||
|
|
||
| // - opts wrong types - | ||
| expectError( | ||
| <Flowplayer | ||
| src={"demoSrc"} | ||
| token={"DEMO_TOKEN"} | ||
| ref={playerRef} | ||
| opts={{ | ||
| title: 2, | ||
| }} | ||
| />, | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍