diff --git a/.github/workflows/cd-news-player.yml b/.github/workflows/cd-news-player.yml deleted file mode 100644 index 91d4caa6e..000000000 --- a/.github/workflows/cd-news-player.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Deployment of News player components - -on: workflow_dispatch - -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - id-token: write - - steps: - - uses: actions/checkout@v4 - # these if statements ensure that a publication only occurs when - # a new release is created: - with: - fetch-depth: 0 # Fetch all history for all tags and branches - - name: read node version from the .nvmrc file - run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) - shell: bash - id: nvmrc - - uses: actions/setup-node@v4 - with: - node-version: ${{steps.nvmrc.outputs.NODE_VERSION}} - # this line is required for the setup-node action to be able to run the npm publish below. - registry-url: 'https://registry.npmjs.org' - - - name: Install - run: npm ci - - name: Clean - run: npm run clean - # - name: Test - # run: npm test - - name: Clean - run: npm run clean - - name: Build - run: npm run build:packages - - # Require the custom version of mux-player and mux-video-ads - # Do it here so we still automatically workspace symlink during development. - - name: Update NPM @mux/mux-player version to gitpkg url - run: npm pkg set dependencies.@mux/mux-player='https://gitpkg.vercel.app/muxinc/elements/packages/mux-player?release-news-player' -w @mux/mux-player-react - - name: Update NPM @mux/mux-video-ads version to gitpkg url - run: npm pkg set dependencies.@mux/mux-video-ads='https://gitpkg.vercel.app/muxinc/elements/packages/mux-video-ads?release-news-player' -w @mux/mux-player-react - - - uses: fregante/setup-git-user@v2 - - name: Append !dist to gitignore - run: echo '!dist' >> .gitignore - - name: Stage dist folders - run: git add --all - - name: Commit changes to git - run: git commit -m "Add dist folders" - - name: Force push to release-news-player - run: git push -f origin main-news-player:release-news-player diff --git a/examples/nextjs-with-typescript/package.json b/examples/nextjs-with-typescript/package.json index 4f763a364..15a3d613d 100644 --- a/examples/nextjs-with-typescript/package.json +++ b/examples/nextjs-with-typescript/package.json @@ -19,6 +19,7 @@ "@mux/mux-uploader-react": ">=1.0.0-beta.0", "@mux/mux-video": ">=0.3.0", "@mux/mux-video-react": ">=0.3.0", + "media-chrome": "^4.9.0", "next": "^14.2.2", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/nextjs-with-typescript/pages/MuxNewsPlayer.tsx b/examples/nextjs-with-typescript/pages/MuxNewsPlayer.tsx new file mode 100644 index 000000000..094581dc0 --- /dev/null +++ b/examples/nextjs-with-typescript/pages/MuxNewsPlayer.tsx @@ -0,0 +1,81 @@ +import Head from 'next/head'; +import Script from 'next/script'; +import { useState } from 'react'; +import MuxNewsPlayer from '@mux/mux-player-react/news'; + +function MuxNewsPlayerPage() { + + const relatedVideos = [ + { + imageUrl: "https://image.mux.com/gZh02tKCI015W6k2XdYSh4srGnksYvsoT1uHsYOlv4Blo/thumbnail.webp", + title: "Test video title 1", + playbackId: "gZh02tKCI015W6k2XdYSh4srGnksYvsoT1uHsYOlv4Blo", + adTagUrl: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=", + }, + { + imageUrl: "https://image.mux.com/VcmKA6aqzIzlg3MayLJDnbF55kX00mds028Z65QxvBYaA/thumbnail.webp", + title: "Test video title 2", + playbackId: "VcmKA6aqzIzlg3MayLJDnbF55kX00mds028Z65QxvBYaA", + adTagUrl: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonly&ciu_szs=300x250%2C728x90&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=", + }, + { + imageUrl: "https://image.mux.com/maVbJv2GSYNRgS02kPXOOGdJMWGU1mkA019ZUjYE7VU7k/thumbnail.webp", + title: "Test video title 3", + playbackId: "maVbJv2GSYNRgS02kPXOOGdJMWGU1mkA019ZUjYE7VU7k", + adTagUrl: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonlybumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=", + }, + ]; + + const [sdkReady, setSdkReady] = useState(false); + + return ( + <> +
+