Certainly! Hereās a well-structured answer you could give on Laracasts to address both bugs, and provide some guidance:
Thanks for reporting these issues! Iāll address both points and provide some troubleshooting steps and recommendations.
1. Fullscreen Mode Causes Video Playback Error
Diagnosis:
This error commonly arises in custom video players when the video DOM node is replaced or upgraded while in fullscreen, or when the player attempts to load a new video source without properly exiting fullscreen first. Many browsers restrict DOM manipulations while in fullscreen for security and stability reasons.
Suggestion:
When switching to the next lesson/video, explicitly exit fullscreen mode via the video player's API before updating the video source.
Example fix using vanilla JS:
function exitFullscreenIfActive() {
if (document.fullscreenElement) {
document.exitFullscreen();
}
}
function autoSwitchToNextLesson(nextVideoUrl) {
exitFullscreenIfActive();
// Now safely set the new video URL/source here
// e.g., videoPlayer.src = nextVideoUrl;
}
If you're using a frontend framework or a video player library (like Video.js), the approach will be similarāalways exit fullscreen before switching sources. This should prevent the āInvalid playback URLā error.
2. Auto Switch Marks Lesson as "Not Complete"
Diagnosis:
Sounds like the client-side state or backend marking logic resets the completed state when revisiting and auto-switching lessons, possibly due to optimistic updates or API mis-handling.
Suggestion:
Ensure your āmark as completeā logic properly checks for existing completion status and does not inadvertently unset it. When auto-switching, make sure to only send API requests to mark as complete and never to mark as incomplete, unless the user intentionally requests that.
Example (pseudo-code):
function handleLessonEnd(currentLessonId) {
if (!hasBeenMarkedComplete(currentLessonId)) {
markLessonAsComplete(currentLessonId);
}
autoSwitchToNextLesson();
}
If youāre using Vue/React, make sure your state reflects the APIās true status and doesn't overwrite the completed status on auto-navigation.
Where to Report Bugs
There isnāt an official bug submission form for Laracasts, but posting here is the right move! Staff and community members monitor this forum. If you want direct support, you can use the Contact form (found at the footer of the site) for persistent issues.
TL;DR
- Explicitly exit fullscreen mode before switching video sources to avoid playback URL errors.
- Confirm auto-switch logic does not unset an already completed lesson when revisiting or auto-switching.
- Use the Laracasts Contact form for additional support if needed.
Let me know if youād like more specific code samples based on your front-end stack or video player library!