Skip to content

Commit

Permalink
fix: use Sutro as default
Browse files Browse the repository at this point in the history
  • Loading branch information
luwes committed Nov 5, 2024
1 parent 75ee2c8 commit b7ff54c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 96 deletions.
4 changes: 2 additions & 2 deletions examples/default-provider/app/(default)/custom-theme/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Metadata } from 'next';
import Video from 'next-video';
import Sutro from 'player.style/sutro/react';
import Instaplay from 'player.style/instaplay/react';
import getStarted from '/videos/get-started.mp4?thumbnailTime=0';

export const metadata: Metadata = {
Expand All @@ -11,7 +11,7 @@ export default function Page() {
return (
<>
<section>
<Video src={getStarted} theme={Sutro}>
<Video src={getStarted} theme={Instaplay}>
<track kind="captions" src="/get-started.vtt" srcLang="en" label="English" default />
</Video>
</section>
Expand Down
17 changes: 17 additions & 0 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@
"chalk": "^4.1.2",
"chokidar": "^3.6.0",
"magicast": "^0.3.4",
"resolve": "^1.22.8",
"media-chrome": "^4.2.3",
"player.style": "^0.0.12",
"resolve": "^1.22.8",
"symlink-dir": "^5.2.1",
"undici": "^5.28.4",
"yargs": "^17.7.2"
Expand Down
4 changes: 2 additions & 2 deletions src/components/players/default-player.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { forwardRef, Suspense, lazy, Children, isValidElement } from 'react';
import Sutro from 'player.style/sutro/react';
import { getPlaybackId, getPosterURLFromPlaybackId } from '../../providers/mux/transformer.js';
import { getUrlExtension, svgBlurImage } from '../utils.js';

import DefaultTheme from './default-theme.js';
import type { Props as MuxVideoProps } from './mux-video-react.js';
import type { PlayerProps } from '../types.js';

Expand All @@ -20,7 +20,7 @@ const DefaultPlayer = forwardRef((allProps: DefaultPlayerProps, forwardedRef: an
controls,
poster,
blurDataURL,
theme: Theme = DefaultTheme,
theme: Theme = Sutro,
...rest
} = allProps;

Expand Down
88 changes: 0 additions & 88 deletions src/components/players/default-theme.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions tests/components/video.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ test('renders media-controller and mux-video', async () => {

const wrapper = create(<Video src={asset} />);
await setTimeout(50);
console.log(JSON.stringify(wrapper.toJSON()));
assert.equal(wrapper.toJSON().children[2].type, 'media-controller');
assert.equal(wrapper.toJSON().children[2].children[1].type, 'mux-video');

assert.equal(wrapper.toJSON().children[1].type, 'media-theme-sutro');
assert.equal(wrapper.toJSON().children[1].children[1].type, 'mux-video');
assert.equal(
wrapper.root.findByType('mux-video').parent.props.playbackId,
'zNYmqdvJ61gt5uip02zPid01rYIPyyzVRVKQChgSgJlaY'
Expand Down

0 comments on commit b7ff54c

Please sign in to comment.