Skip to content

Preview video from IPFS, preserve-original checkbox#66

Closed
magent-cryptograss wants to merge 8 commits into
cryptograss:mainfrom
magent-cryptograss:preview-transcoding
Closed

Preview video from IPFS, preserve-original checkbox#66
magent-cryptograss wants to merge 8 commits into
cryptograss:mainfrom
magent-cryptograss:preview-transcoding

Conversation

@magent-cryptograss

Copy link
Copy Markdown
Contributor

Summary

  • Rewrite initVideoPreview() to load 480p MP4 preview from IPFS instead of streaming full original from staging
  • Polls delivery-kid every 10s while transcoding is in progress
  • Falls back to staging URL if no preview available
  • Add "Keep original file" checkbox (sends preserve_original in finalize request)
  • Add preview status div and CSS

Test plan

  • Visit ReleaseDraft for video draft → preview loads from IPFS or staging fallback
  • New video upload → "Preview is being transcoded..." → preview appears after Coconut finishes
  • "Keep original file" checkbox → original preserved on storage box
  • Not logged in → shows "Log in to preview video."

Play the video, pause at the desired start/end points, click "Set start"
or "Set end" to capture the playback position. Values are stored as
trim_start_seconds and trim_end_seconds in the draft YAML content block.

These will be passed to Coconut (offset/duration) or ffmpeg (-ss/-to)
during finalization.
…on_time

- Move "File type override" into a collapsed "More settings" section
- Reword blockheight section: "When did this happen?" with date picker
  first, block height as secondary option
- Hide upload_blockheight display (server-side, no need to show it)
- Pre-fill date from video creation_time metadata when available
- Preserve creation_time through YAML round-trip
The local linear estimate (12s slots from merge genesis) drifts
noticeably. Now all three date pickers (ReleaseDraft, DeliverVideo,
DeliverBlueRailroad) call Etherscan's getblocknobytime API for the
exact block. The local estimate still shows instantly as a placeholder
while the API call is in flight.
The local linear estimate (12s slots from merge) was drifting ~11 days
for recent blocks. Now all three pages fetch the actual block timestamp
via eth_getBlockByNumber from publicnode.com RPC. Local estimate still
shows instantly as placeholder while the RPC call is in flight.
Etherscan V1 API is deprecated and V2 requires an API key. Removed all
Etherscan calls. Block-to-date display now shows a spinner and waits
for the Ethereum RPC response instead of showing a wrong local estimate.
Date-to-block still uses the local formula (close enough for day-level).
Rewrite initVideoPreview to check delivery-kid for preview transcoding
status: if a 480p MP4 preview is ready on IPFS, play that instead of
streaming the full original from staging. Polls every 10s if transcoding
is in progress. Falls back to staging URL if no preview available.

- Add preview status div and preserve-original checkbox to PHP
- JS polls delivery-kid draft API for preview_mp4_cid
- Add CSS for .rd-preview-status and .rd-preserve-label
- Wire preserve_original checkbox into finalize request body
The renderGenericForm (used for type: other drafts from Special:UploadContent)
was missing the video player, preview status, and trim controls that were
only in renderVideoForm. Content drafts with video files now get the same
preview/trim UI.
@magent-cryptograss

Copy link
Copy Markdown
Contributor Author

Superseded by #68 (rebased cleanly on current main)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant