mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.75k stars 505 forks source link

TIMESTAMP_IN_TIMEBAR does not work. #694

Open jp-rad opened 1 year ago

jp-rad commented 1 year ago

Describe the issue A clear and concise description of what the issue is.

To Reproduce

  1. TIMESTAMP_IN_TIMEBAR = True # shows timestamped comments in the timebar for videos
  2. Add a comment, 'mm:ssorhh:mm:ss`
  3. Comment without timestamped

Expected behavior

  1. shows timestamped comments in the timebar for videos
mgogoulos commented 1 year ago

it seems that timestamp has broken after video.js upgrade - https://github.com/mediacms-io/mediacms/pull/519

trying to fix, any help is appreciated!

jp-rad commented 1 year ago

I will try.

mgogoulos commented 1 year ago

To give more insight here, the video.js upgrade on https://github.com/mediacms-io/mediacms/pull/519 made this feature break, and it's strange how a video.js (an external library) could trigger this issue. When you specify timestamp on the URL and start a video, you see that it starts on the correct time but immediately after that it starts from the beginning of the video, as sure as a function is triggered that does this

jp-rad commented 1 year ago

setTimestampAnchorsAndMarkers() and initialize() are called on the loadedmetadata event, and thus the order of their execution is undefined.

setTimestampAnchorsAndMarkers() https://github.com/mediacms-io/mediacms/blob/main/frontend/src/static/js/components/comments/Comments.jsx#L447

initialize() https://github.com/mediacms-io/mediacms/blob/main/frontend/src/static/js/components/comments/videojs-markers.js#L454

jp-rad commented 1 year ago

setTimestampAnchorsAndMarkers() is only called on the loadedmetadata event, so adding or removing comments during video playback will not change the timebar markers.

https://github.com/mediacms-io/mediacms/blob/main/frontend/src/static/js/components/comments/Comments.jsx#L447

mgogoulos commented 1 year ago

I think the problem is related with the video player doing something wrong, so not necessarily related with comments, I guess it's something on frontend/src/static/js/components/video-player/VideoPlayer.jsx

jp-rad commented 1 year ago

Pull Requested, https://github.com/mediacms-io/mediacms/pull/706 However, there is a problem with the following: the comment does not appear on the video.

  1. upload videos
  2. Add a timed comment to each video
  3. When one video is played, comments appear on the video according to the timeline
  4. Clicking on the Up next video will play the next video and display comments on the video
  5. Pause video
  6. Clicking on the Up next video
  7. so the next video will play, but no comments will appear on the video.