Skip to content
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

Update with-mux-video to use latest upchunk and replace video player with mux-player-react #37621

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions examples/with-mux-video/components/video-player.js

This file was deleted.

4 changes: 2 additions & 2 deletions examples/with-mux-video/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
},
"dependencies": {
"@mux/mux-node": "^2.8.0",
"@mux/upchunk": "^2.0.0",
"hls.js": "^0.13.2",
"@mux-elements/mux-player-react": "0.1.0-beta.19",
"@mux/upchunk": "^2.3.1",
"next": "latest",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
9 changes: 4 additions & 5 deletions examples/with-mux-video/pages/v/[id].js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import MuxPlayer from '@mux-elements/mux-player-react'
import Link from 'next/link'
import Layout from '../../components/layout'
import VideoPlayer from '../../components/video-player'
import Spinner from '../../components/spinner'
import { MUX_HOME_PAGE_URL } from '../../constants'
import { useRouter } from 'next/router'

export function getStaticProps({ params: { id: playbackId } }) {
const src = `https://stream.mux.com/${playbackId}.m3u8`
const poster = `https://image.mux.com/${playbackId}/thumbnail.png`

return { props: { playbackId, src, poster } }
return { props: { playbackId, poster } }
}

export function getStaticPaths() {
Expand All @@ -33,7 +32,7 @@ const Code = ({ children }) => (
</>
)

export default function Playback({ playbackId, src, poster }) {
export default function Playback({ playbackId, poster }) {
const router = useRouter()

if (router.isFallback) {
Expand All @@ -51,7 +50,7 @@ export default function Playback({ playbackId, src, poster }) {
loadTwitterWidget
>
<div className="flash-message">This video is ready for playback</div>
<VideoPlayer src={src} poster={poster} />
<MuxPlayer style={{ width: '100%' }} playbackId={playbackId} />
<p>
Go{' '}
<Link href="/">
Expand Down