when I record a video with the Media Recorder API and download & open it with VLC, length of the video is unknow.
Furthermore, on Chrome mobile (52.0.2743.98) if I read it in a video tag, length isn't show, currentTime will always be 0 and the ontimeupdate will only launch when the video end.
On Chrome desktop (52.0.2743.116), length isn't show but ontimeupdate and currentTime seem to work fine.
I've recorded and downloaded the video from the developers google demo. The video is a webm as It seem to be the only type supported by chrome
Any idea ?
Metadata from ffpmeg :
libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, matroska,webm, from 'test.webm': Metadata: encoder : Chrome Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default) Stream #0:1(eng): Video: vp9 (Profile 0), yuv420p(tv), 480x640, SAR 1:1 DAR 3:4, 30 fps, 30 tbr, 1k tbn, 1k tbc (default) File 'metadata.txt' already exists. Overwrite ? [y/N] y Output #0, ffmetadata, to 'metadata.txt': Metadata: encoder : Lavf56.40.101 Stream mapping: size= 0kB time=--577014:-32:-22.-77 bitrate=N/A video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
The issue with the video length not being displayed and the ontimeupdate event only being triggered at the end of the video on Chrome mobile is likely caused by the fact that the browser is unable to determine the duration of the video. This can happen if the metadata of the video file is not complete or if the file is not properly encoded.
To fix this issue, you can try using a tool like ffmpeg to check the metadata of the video file and ensure that it is complete and correct. You can also try re-encoding the video file to a different format or with different encoding settings to see if that resolves the issue.
It is also worth noting that the Media Recorder API is still an experimental technology and may not work consistently across all browsers and devices. If you continue to experience issues with the Media Recorder API, you may want to consider using a different solution for recording and playing video.