Tengo información del servidor que regresa después de grabar un video de otra fuente y tengo problemas para encontrar la duración de ese video. Intenté calcular desde StartTime, EndTime y ProcessingTime, pero el resultado aún no es correcto, ya que abro 1 video desde Player. Consulte los datos y la fórmula a continuación.
<published>true</published> <start_time>1648193086010</start_time> <end_time>1648193354234</end_time> <participants>2</participants> <meeting id="eb1fb5d06accfce0a69dee1908cef4b392d2e24d-1648193086010" externalId="OFFICIAL_1ON1_55_20035" name="OFFICIAL_1ON1_55_20035" breakout="false"/> <meta> <isBreakout>false</isBreakout> <meetingId>OFFICIAL_1ON1_55_20035</meetingId> <meetingName>OFFICIAL_1ON1_55_20035</meetingName> </meta> <playback> <format>video</format> <link>recordings/eb1fb5d06accfce0a69dee1908cef4b392d2e24d-1648193086010/meeting.mp4</link> <processing_time>30928</processing_time> <extensions> <preview> <images> <image width="176" height="136" alt="Welcome To BigBlueButton">https://big1.honrada.com/presentation/eb1fb5d06accfce0a69dee1908cef4b392d2e24d-1648193086010/presentation/d2d9a672040fbde2a47a10bf6c37b6a4b5ae$ <image width="176" height="136" alt="This slide left blank for whiteboard">https://big1.honrada.com/presentation/eb1fb5d06accfce0a69dee1908cef4b392d2e24d-1648193086010/presentation/d2d9a672040fbde2a47a10bf$ <image width="176" height="136" alt="This slide left blank for whiteboard">https://big1.honrada.com/presentation/eb1fb5d06accfce0a69dee1908cef4b392d2e24d-1648193086010/presentation/d2d9a672040fbde2a47a10bf$ </images> </preview> </extensions> <size>4212315</size> </playback> <raw_size>2308052</raw_size> </recording>
Y aquí está mi código:
function DURATION(duration) { const length = moment.duration(duration);h const hour = length.hours(); const minute = length.minutes(); const second = length.seconds(); return hour + ':' + minute + ':' + second;
}
El resultado es 03:42