-
Notifications
You must be signed in to change notification settings - Fork 0
feat(thumb): update thumbnail plugin #137
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
Open
renefloor
wants to merge
12
commits into
main
Choose a base branch
from
feat/update-thumbnail-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
daae5c6
fix(thumb): unify platform-channel async pattern and fix result delivery
renefloor 06d262f
refactor(thumb): migrate platform channel to Pigeon and rewrite iOS i…
renefloor 0cf4109
feat(thumb): add macOS support to stream_thumbnail
renefloor 603d200
feat(thumb): add Windows support to stream_thumbnail
renefloor 670c647
feat(thumb): add Linux support to stream_thumbnail
renefloor fe6ff25
ci(thumb): add native build coverage for all stream_thumbnail platforms
renefloor 30afed0
fix(thumb): bump example macOS deployment target to 12.0
renefloor c381bc5
Fix linux compilation
renefloor 17e74e8
fix(thumb): bump example iOS deployment target to 15.0
renefloor b498043
Fix PR reviews
renefloor 70b8b52
improve workflows
renefloor 89e619a
Add warning for thumbnail path
renefloor 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Bootstrap Workspace | ||
| description: > | ||
| Installs Flutter, activates melos and bootstraps the melos workspace, so every | ||
| package resolves its sibling packages from this repository instead of pub.dev. | ||
|
|
||
| # NOTE: the calling job must check the repository out first — a local action | ||
| # cannot check out the repository it lives in. | ||
|
|
||
| inputs: | ||
| flutter-channel: | ||
| description: The Flutter channel to install. | ||
| required: false | ||
| default: stable | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| cache: true | ||
| cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} | ||
| channel: ${{ inputs.flutter-channel }} | ||
|
|
||
| - name: Install Melos | ||
| shell: bash | ||
| working-directory: ${{ github.workspace }} | ||
| run: flutter pub global activate melos | ||
|
|
||
| # Bootstrapping is what writes the melos-managed `pubspec_overrides.yaml` | ||
| # files, which are gitignored. Without it, a plain `flutter pub get` in an | ||
| # example app resolves the very plugin it is supposed to be testing from | ||
| # pub.dev instead of from this checkout. | ||
| # | ||
| # Invoked through `pub global run` rather than as a bare `melos`, so it does | ||
| # not depend on the pub-cache bin directory being on PATH — that differs | ||
| # between the ubuntu, macos and windows runners this action is used from. | ||
| - name: Bootstrap Workspace | ||
| shell: bash | ||
| working-directory: ${{ github.workspace }} | ||
| run: flutter pub global run melos bootstrap | ||
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,145 @@ | ||
| name: stream_thumbnail_native_builds | ||
|
|
||
| env: | ||
| FLUTTER_CHANNEL: stable | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - ready_for_review | ||
| paths: | ||
| - 'packages/stream_thumbnail/**' | ||
| - '.github/actions/bootstrap/action.yml' | ||
| - '.github/workflows/stream_thumbnail_native_builds.yml' | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'packages/stream_thumbnail/**' | ||
| - '.github/actions/bootstrap/action.yml' | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| - '.github/workflows/stream_thumbnail_native_builds.yml' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| android: | ||
| timeout-minutes: 20 | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: packages/stream_thumbnail/example | ||
| steps: | ||
| - name: Git Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Bootstrap Workspace | ||
| uses: ./.github/actions/bootstrap | ||
| with: | ||
| flutter-channel: ${{ env.FLUTTER_CHANNEL }} | ||
|
|
||
| - name: Build APK | ||
| run: flutter build apk --debug | ||
|
|
||
| ios: | ||
| timeout-minutes: 20 | ||
| runs-on: macos-latest | ||
| defaults: | ||
| run: | ||
| working-directory: packages/stream_thumbnail/example | ||
| steps: | ||
| - name: Git Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Bootstrap Workspace | ||
| uses: ./.github/actions/bootstrap | ||
| with: | ||
| flutter-channel: ${{ env.FLUTTER_CHANNEL }} | ||
|
|
||
| - name: Build iOS (no codesign) | ||
| run: flutter build ios --debug --no-codesign | ||
|
|
||
| macos: | ||
| timeout-minutes: 20 | ||
| runs-on: macos-latest | ||
| defaults: | ||
| run: | ||
| working-directory: packages/stream_thumbnail/example | ||
| steps: | ||
| - name: Git Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Bootstrap Workspace | ||
| uses: ./.github/actions/bootstrap | ||
| with: | ||
| flutter-channel: ${{ env.FLUTTER_CHANNEL }} | ||
|
|
||
| - name: Build macOS | ||
| run: flutter build macos --debug | ||
|
|
||
| windows: | ||
| timeout-minutes: 20 | ||
| runs-on: windows-latest | ||
| defaults: | ||
| run: | ||
| working-directory: packages/stream_thumbnail/example | ||
| steps: | ||
| - name: Git Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Bootstrap Workspace | ||
| uses: ./.github/actions/bootstrap | ||
| with: | ||
| flutter-channel: ${{ env.FLUTTER_CHANNEL }} | ||
|
|
||
| - name: Build Windows | ||
| run: flutter build windows --debug | ||
|
|
||
| linux: | ||
| timeout-minutes: 20 | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: packages/stream_thumbnail/example | ||
| steps: | ||
| - name: Git Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install Linux Build Dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y ninja-build libgtk-3-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libwebp-dev | ||
|
|
||
| - name: Bootstrap Workspace | ||
| uses: ./.github/actions/bootstrap | ||
| with: | ||
| flutter-channel: ${{ env.FLUTTER_CHANNEL }} | ||
|
|
||
| - name: Build Linux | ||
| run: flutter build linux --debug | ||
|
|
||
| web: | ||
| timeout-minutes: 20 | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: packages/stream_thumbnail/example | ||
| steps: | ||
| - name: Git Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Bootstrap Workspace | ||
| uses: ./.github/actions/bootstrap | ||
| with: | ||
| flutter-channel: ${{ env.FLUTTER_CHANNEL }} | ||
|
|
||
| - name: Build Web | ||
| run: flutter build web | ||
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 |
|---|---|---|
| @@ -1,3 +1,41 @@ | ||
| ## Upcoming | ||
|
|
||
| ### ✨ Features | ||
|
|
||
| - Added macOS support, sharing the same `AVAssetImageGenerator` + `libwebp` approach | ||
| as iOS. | ||
| - Added Windows support, via Media Foundation for decoding and WIC for JPEG/PNG | ||
| encoding. `StreamThumbnailFormat.webp` and `headers` (for authenticated remote | ||
| videos) are not yet supported on Windows. | ||
| - Added Linux support, via FFmpeg for decoding and jpeg/png encoding, and `libwebp` | ||
| for WebP — the only platform besides Android with full format support, including | ||
| `headers` for authenticated remote videos. | ||
|
|
||
| ### 💥 BREAKING CHANGES | ||
|
|
||
| - `thumbnailFiles` now fails fast: if any video fails to produce a thumbnail, the call | ||
| throws instead of silently omitting that video from the returned list. | ||
| - `thumbnailFiles` now throws an `ArgumentError` when `thumbnailPath` names a file rather | ||
| than a directory and more than one video was given. That combination pointed every | ||
| video in the batch at the same output path. | ||
|
|
||
| ### 🐞 Fixed | ||
|
|
||
| - Fixed a crash on iOS where a failed `thumbnailData` call returned `null` instead of an | ||
| error, causing the Dart side to crash casting `null` to `Uint8List`. | ||
| - Native errors now surface as typed `PlatformException`s on all platforms instead of a | ||
| generic `Exception` wrapping a raw Android stack trace. | ||
| - Unified the platform-channel implementation: Android previously acknowledged a call | ||
| immediately and delivered the real result via a separate reverse invocation; it now | ||
| replies once with the actual result, like iOS and web. | ||
|
|
||
| ### 🔧 Internal | ||
|
|
||
| - Migrated the Android/iOS platform channel to Pigeon-generated, type-safe messaging | ||
| and rewrote the iOS plugin in Swift (previously Objective-C). The public Dart API is | ||
| unchanged; web keeps its separate hand-written implementation, since Pigeon does not | ||
| support it. | ||
|
|
||
| ## 0.1.0 | ||
|
|
||
| * Initial release. |
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.
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.
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: GetStream/stream-core-flutter
Length of output: 4565
Pin the third-party action to a full commit SHA.
subosito/flutter-action@v2is a mutable tag, so this workflow can execute unreviewed or compromised code if the tag is moved. Pin an immutable full commit SHA and update it through dependency automation.🤖 Prompt for AI Agents