Overview
The Bİ DOLU İÇECEK application supports promotional videos that open in a modal when users click the video icon (🎥) in the header. This guide shows you how to add, configure, and manage videos.Video Directory Structure
Videos are stored in thepublic/videos/ directory:
Supported Video Formats
The application supports multiple video formats for maximum browser compatibility.
| Format | Extension | Browser Support | Recommended |
|---|---|---|---|
| MP4 | .mp4 | All modern browsers | ✓ Yes |
| WebM | .webm | Chrome, Firefox, Edge | Optional |
| OGV | .ogv | Older browsers | Optional |
Format Recommendations
Primary Format: MP4 (H.264 codec)- Best compatibility
- Good compression
- Supported everywhere
- Better compression than MP4
- Smaller file sizes
- Good for modern browsers
Adding a Promotional Video
Add video file
Place your video in Video specifications:
public/videos/:- Maximum size: 50MB (recommended)
- Resolution: 1920x1080 (Full HD)
- Aspect ratio: 16:9
- Duration: 30-120 seconds recommended
Update socialMedia.js configuration
Open
src/data/socialMedia.js and update the video URL:src/data/socialMedia.js
Video Modal Configuration
The video modal is managed bysrc/components/VideoModal.js and provides:
- Auto-play: Video starts automatically when modal opens
- Controls: Play/pause, volume, fullscreen
- Responsive: Works on mobile and desktop
- Keyboard support: ESC key to close
VideoModal Component
Fromsrc/components/VideoModal.js:
src/components/VideoModal.js
Video Attributes
| Attribute | Description | Value |
|---|---|---|
controls | Show playback controls | Always enabled |
autoPlay | Start automatically | Enabled |
poster | Thumbnail before play | /images/video-poster.jpg |
Adding Multiple Video Formats
For better browser compatibility, provide multiple formats:Video Poster Image
A poster image is the thumbnail shown before the video plays.Adding a Poster
Create poster image
Extract a frame from your video or create a custom thumbnail:Poster specifications:
- Format: JPG or PNG
- Dimensions: 1920x1080 (match video resolution)
- Size: < 200KB
Social Media Configuration
Videos are managed insrc/data/socialMedia.js alongside social media links.
Full Configuration Example
src/data/socialMedia.js
Configuration Fields
| Field | Type | Description | Example |
|---|---|---|---|
id | Number | Unique identifier | 1 |
name | String | Display name | "Tanıtım Videosu" |
type | String | Item type | "video" or "link" or "language" |
videoUrl | String | Video file path | "/videos/tanitim-video.mp4" |
icon | String | Custom icon path | "/images/video-icon.png" or null |
iconPlaceholder | String | Emoji fallback | "🎥" |
target | String | Open behavior | "modal" |
Handling Click Events
ThehandleSocialMediaClick function manages video modal opening:
src/data/socialMedia.js
Video Not Available Placeholder
If no video is configured, the modal shows a placeholder:This appears when
videoUrl is null or the file doesn’t exist.src/components/VideoModal.js
src/App.css (lines 1069-1099):
src/App.css
Video Optimization
Compress Videos
Using FFmpeg to compress:Recommended Settings
| Setting | Value | Reason |
|---|---|---|
| Resolution | 1920x1080 | Full HD, good quality |
| Frame rate | 30 fps | Smooth playback |
| Bitrate | 2-5 Mbps | Balance size/quality |
| Codec | H.264 | Universal support |
Troubleshooting
Video Doesn’t Play
Problem: Video path is incorrect Solution:Video Shows Black Screen
Problem: Video codec not supported or corrupted Solution: Re-encode with H.264 codec:Modal Doesn’t Open
Problem:videoUrl is null or missing
Solution: Update src/data/socialMedia.js:
Auto-play Not Working on Mobile
Problem: Mobile browsers restrict auto-play Solution: This is by design. Users must interact first. TheautoPlay attribute works best on desktop.
Custom Video Icon (Optional)
Replace the 🎥 emoji with a custom icon:Next Steps
Adding Images
Learn about managing images and visual assets
Styling
Customize the video modal appearance