feat(products): 成片库视频内联播放,去掉弹窗 + 自适应比例 #1576

Merged
xiaoxia merged 1 commits from feat/product-inline-player into develop 2026-08-31 16:55:15 +08:00
Owner

改动内容

去掉弹窗播放,改为内联播放

  • ProductCard.tsx:缩略图区域从 <img> + 播放按钮覆盖层改为 <video> 元素
    • 点击播放按钮 → 内联播放,显示原生 controls
    • 再次点击暂停,onEnded 回到缩略图状态
    • videoUrl 加载失败自动降级为缩略图
  • ProductLibrary.tsx:移除 playingProduct 状态和 VideoPlayer 弹窗组件引用

消除视频空白

  • products.css.xx-product-thumb 去掉固定 aspect-ratio: 9/16max-height: 220px
  • 视频比例通过 onLoadedMetadata 动态获取 videoWidth/videoHeight,设置容器 aspect-ratio
  • 获取不到实际比例时默认 16:9(横屏)
  • 新增 .xx-product-thumb-video 样式:object-fit: contain,确保不裁剪
  • 卡片网格保持 4 列不变,卡片高度自适应视频内容

未改动

  • 后端接口
  • 批量操作、筛选、下载、分享、删除等功能
  • VideoPlayer.tsx 文件保留(详情页 DetailVideoPlayer 仍在使用)
## 改动内容 ### 去掉弹窗播放,改为内联播放 - **ProductCard.tsx**:缩略图区域从 `<img>` + 播放按钮覆盖层改为 `<video>` 元素 - 点击播放按钮 → 内联播放,显示原生 `controls` - 再次点击暂停,`onEnded` 回到缩略图状态 - `videoUrl` 加载失败自动降级为缩略图 - **ProductLibrary.tsx**:移除 `playingProduct` 状态和 `VideoPlayer` 弹窗组件引用 ### 消除视频空白 - **products.css**:`.xx-product-thumb` 去掉固定 `aspect-ratio: 9/16` 和 `max-height: 220px` - 视频比例通过 `onLoadedMetadata` 动态获取 `videoWidth/videoHeight`,设置容器 `aspect-ratio` - 获取不到实际比例时默认 `16:9`(横屏) - 新增 `.xx-product-thumb-video` 样式:`object-fit: contain`,确保不裁剪 - 卡片网格保持 4 列不变,卡片高度自适应视频内容 ### 未改动 - 后端接口 - 批量操作、筛选、下载、分享、删除等功能 - VideoPlayer.tsx 文件保留(详情页 DetailVideoPlayer 仍在使用)
xiaoxia added 1 commit 2026-08-31 16:40:33 +08:00
feat(products): 成片库视频内联播放,去掉弹窗 + 自适应比例
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3m35s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 4m7s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 4m5s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 4m40s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 5m18s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 6m13s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
AI Code Review / AI Code Review (pull_request) Successful in 10m1s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 2m9s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 2m16s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 10m52s
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 3m7s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 43s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 4m1s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Waiting to run
8437d4060b
- ProductCard: 缩略图区域改为 <video> 内联播放,点击播放按钮原生 controls
- 视频比例通过 onLoadedMetadata 动态获取,获取不到时默认 16:9
- ProductLibrary: 移除 playingProduct 状态和 VideoPlayer 弹窗组件
- products.css: .xx-product-thumb 去掉固定 9:16 aspect-ratio,
  新增 .xx-product-thumb-video 样式(object-fit: contain)
- 卡片网格保持 4 列,卡片高度自适应视频内容

🚀 预览环境已部署

项目 详情
PR号 #1576
预览链接 https://pr-1576.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1576 | | 预览链接 | [https://pr-1576.preview.xiaoxiajianji.com](https://pr-1576.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
xiaoxia merged commit 42939a557f into develop 2026-08-31 16:55:15 +08:00

🗑️ 预览环境已清理

PR #1576 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1576 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.