stream.new
stream.new copied to clipboard
deleted assets: thumbnail flashes before showing error
Repro steps
- upload a video
- view the video
- delete the asset from Mux
- try to view the video
- see that the thumbnail flashes before showing an error message
Internally, this is what's happening:
- video player loads with
poster=
attribute - even though the asset is deleted, previously rendered thumbnail images are cached by cdns for a while (days), so the request to load the poster image (thumbnail) succeeds
- the m3u8 playlist 404s, which triggers the correct error "This video does not exist"
Solution -- maybe there's something better but this is the best idea I have:
- before rendering the video player do a
fetch
GET to them3u8
, if it 404s then fallback into the error state