diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2b688a8..74efe245 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,17 +16,17 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout code repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x - name: load cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.pnpm-store @@ -34,7 +34,7 @@ jobs: restore-keys: | ${{ runner.os }} - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: latest run_install: true diff --git a/.github/workflows/compressed-size.yml b/.github/workflows/compressed-size.yml index 2df6e831..66aab5ab 100644 --- a/.github/workflows/compressed-size.yml +++ b/.github/workflows/compressed-size.yml @@ -20,15 +20,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x - name: Install pnpm - uses: pnpm/action-setup@v2.2.4 + uses: pnpm/action-setup@v4 with: version: latest run_install: false @@ -38,7 +38,7 @@ jobs: run: | echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" - - uses: actions/cache@v3 + - uses: actions/cache@v4 name: Setup pnpm cache with: path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} diff --git a/packages/docs/src/pages/index.mdx b/packages/docs/src/pages/index.mdx index 27799fad..5c4e7704 100644 --- a/packages/docs/src/pages/index.mdx +++ b/packages/docs/src/pages/index.mdx @@ -55,7 +55,7 @@ import { Playlist, Chromecast, AirPlay } from '@oplayer/plugins' hls({ forceHLS: true }), dash(), mpegts(), - !isMobile && danmaku({ enable: true, fontSize: 0.75, displaySender: false }), + danmaku({ enable: !isMobile, fontSize: 0.75, displaySender: false }), new Playlist({ initialIndex: 0, autoNext: true, diff --git a/packages/plugins/package.json b/packages/plugins/package.json index e81f5b35..91168e3b 100644 --- a/packages/plugins/package.json +++ b/packages/plugins/package.json @@ -1,6 +1,6 @@ { "name": "@oplayer/plugins", - "version": "1.0.13", + "version": "1.0.14-beta.0", "author": "shiyiya", "description": "oplayer's plugin", "homepage": "https://github.com/shiyiya/oplayer", diff --git a/packages/plugins/src/chromecast.ts b/packages/plugins/src/chromecast.ts index ebb5c779..c6afdc76 100644 --- a/packages/plugins/src/chromecast.ts +++ b/packages/plugins/src/chromecast.ts @@ -16,7 +16,7 @@ export interface ChromeCastOptions { androidReceiverCompatible?: boolean | undefined } -class ChromeCast implements PlayerPlugin { +class Chromecast implements PlayerPlugin { readonly name = 'oplayer-plugin-chromecast' readonly version = __VERSION__ @@ -87,7 +87,12 @@ class ChromeCast implements PlayerPlugin { __buildRequest() { const { source, isLive } = this.player.options - const mediaInfo = new chrome.cast.media.MediaInfo(source.src, source.type || 'video/mp4') + + const mediaInfo = new chrome.cast.media.MediaInfo( + source.src, + this.player.loader?.key == 'hls' ? 'application/x-mpegurl' : 'video/mp4' + ) + ;(mediaInfo as any).contentUrl = source.src mediaInfo.streamType = isLive ? chrome.cast.media.StreamType.LIVE : chrome.cast.media.StreamType.BUFFERED const metadata = new chrome.cast.media.GenericMediaMetadata() @@ -143,7 +148,7 @@ class ChromeCast implements PlayerPlugin { const { menu, icons } = this.player.context.ui menu?.register({ - name: 'ChromeCast', + name: 'Chromecast', position: 'top', icon: icons.chromecast || ICON, onClick: () => this.start() @@ -151,4 +156,4 @@ class ChromeCast implements PlayerPlugin { } } -export default ChromeCast +export default Chromecast