fix(media-manager): resolve video preview issues and stabilize tests
- Backend (MediaService):
- Implemented robust contentUrl generation for Drive files using drive.google.com/uc pattern.
- Added mimeType exposure to unified media state.
- Frontend (MediaManager):
- Replaced video tag with iframe embedding the Google Drive Preview player (/preview) for reliable playback.
- Fixed syntax error in console logging causing UI freeze.
- Updated gallery card logic to prioritize video content URLs.
- Tests (Integration):
- Refactored mediaManager.integration.test.ts to align with new logic.
- Mocked DriveApp completely to support orphan adoption flows.
- Updated file renaming expectations to support timestamped filenames.
- Documentation:
- Updated MEMORY.md with video preview strategy.
This commit is contained in:
@ -128,8 +128,12 @@ export class MediaService {
|
||||
source: match ? 'synced' : 'drive_only',
|
||||
thumbnail: `data:image/jpeg;base64,${Utilities.base64Encode(d.file.getThumbnail().getBytes())}`,
|
||||
status: 'active',
|
||||
galleryOrder: d.galleryOrder
|
||||
galleryOrder: d.galleryOrder,
|
||||
mimeType: d.file.getMimeType(),
|
||||
// Use manual download URL construction which is often more reliable for authenticated sessions than getDownloadUrl()
|
||||
contentUrl: `https://drive.google.com/uc?export=download&id=${d.file.getId()}`
|
||||
})
|
||||
// console.log(`[MediaService] File ${d.file.getName()} (${d.file.getId()}): Mime=${d.file.getMimeType()}, ContentUrl=https://drive.google.com/uc?export=download&id=${d.file.getId()}`)
|
||||
})
|
||||
|
||||
// Find Shopify Orphans
|
||||
|
||||
Reference in New Issue
Block a user