Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
Fixes Youtube Video duration fetching. Youtube may reject requests to load the video, which means we can't fetch the duration. If this happened previously, the youtube video would load in the overlay (and sometimes succeed to play) while the backend would wait for 0 seconds. This could create situations where multiple videos would play, or setups would otherwise break.
With these changes, if the video effect is set to wait and there's an error retrieving the video duration, the effect logs an error message and stops without playing the video. If the effect is not set to wait, it'll continue to send the youtube video to the overlay. During testing, Youtube was more likely to block the iframe API in electron than the iframe API in the overlay, so this can help some videos to still play.
Applicable Issues
N/A
Testing
These changes were extensively tested for issues, and pre-existing setups relying on wait for video duration work properly again.