# Video Background Debug Guide ## What I Fixed Added **multiple listeners** to catch the video URL trait change: 1. **Component-level listener** (in video-section init) 2. **Global update listener** (component:update event) 3. **Console logging** to see what's happening ## How to Test ### Step 1: Open Browser Console 1. Open `/home/jknapp/code/site-builder/index.html` 2. Press **F12** to open Developer Tools 3. Click **Console** tab 4. Keep it open while testing ### Step 2: Add Video Background Section 1. Drag "Section (Video BG)" to canvas 2. Click on the section to select it ### Step 3: Enter Video URL 1. Right sidebar → **Settings** tab 2. Find **"Video URL"** field 3. Enter: `https://www.youtube.com/watch?v=OC7sNfNuTNU` 4. **Press Enter or Tab** (important!) ### Step 4: Check Console Output You should see messages like: ``` Video section updated with URL: https://www.youtube.com/watch?v=OC7sNfNuTNU Applying video URL to wrapper Video URL changed: https://www.youtube.com/watch?v=OC7sNfNuTNU Video wrapper found: true ``` ### Step 5: Check the Video - Placeholder should disappear - Video iframe should appear - If it doesn't, check console for errors ## Troubleshooting Console Messages ### If you see: "Video wrapper not found!" **Problem:** The bg-video-wrapper child element isn't being found **Fix:** 1. Check Layers panel (left sidebar) 2. Expand the section 3. Look for a div with `data-bg-video="true"` 4. If missing, the block structure is broken ### If you see: "Video section updated..." but no video loads **Problem:** The applyVideoUrl function might be failing **Check:** 1. Look for red error messages in console 2. Check if iframe/video elements exist in Layers panel 3. Try a different video URL ### If you see NO console messages **Problem:** The trait change isn't being detected **Try:** 1. Click outside the Video URL field after typing 2. Press Enter after pasting URL 3. Try clicking on a different element, then back to the section 4. Refresh page and try again ## Expected Console Flow ``` 1. Add section to canvas → No messages yet 2. Select section → No messages yet 3. Type URL in Video URL field → No messages yet 4. Press Enter or Tab → "Video section updated with URL: ..." → "Applying video URL to wrapper" → "Video URL changed: ..." → "Video wrapper found: true" 5. Video loads → Placeholder hides → Iframe appears with video ``` ## Manual Verification If console logging works but video doesn't load: ### Check 1: Is the iframe getting the URL? 1. Open Elements tab (next to Console) 2. Find the `