MartinLangbecker / wokubot

MIT License
1 stars 0 forks source link

Use correct media player content when changing file #31

Open MartinLangbecker opened 3 years ago

MartinLangbecker commented 3 years ago

When editing an existing media entry containing an audio or video file and changing its associated media file to a different audio or video file, the media player on the page should be updated to play the newly selected file. Currently, the media player will continue playing the previous file when returning from the file picker, even continuing at the same timestamp.

The most likely cause is that the controller in MediaPlayer is only initialized once when the MediaDetailsScreen is opened. During the initialization process, the source file is set. When a new file is selected, properties like aspect ratio will be changed, but not the actual file content.

Note: This does not effect the saving process. The newly picked file while be correctly saved and, after closing and opening the details screen, displayed. It will also show up in the correct tab based on the file type of the newly selected file.

MartinLangbecker commented 3 years ago

Idea: Extract VideoPlayerController controller from MediaPlayer to MediaUtils and only pass it in through constructor as final parameter. That way, it can be initialized with a new file whenever getMedia(MediaEntry entry) is called.

MartinLangbecker commented 2 years ago

Changed video player to Chewie in commit https://github.com/MartinLangbecker/wokubot/commit/7a93e320b09f05210061634a8a0cb329bb7e086d. The behavior is still the same. Additionally, the edit button is now covered by the overlay controls.