# Assets Directory

This directory contains all media files used by the Trip App.

## Directory Structure

```
assets/
├── videos/
│   ├── prayagwelcome.mp4    # Welcome video
│   ├── v1.mp4               # Music video 1
│   ├── v2.mp4               # Music video 2
│   ├── v3.mp4               # Music video 3
│   └── ad_video.mp4         # Advertisement video
└── audio/
    ├── audio_03_r1_45.mp3   # Fallback announcement
    ├── audio_stop1.mp3      # Stop announcement 1
    ├── audio_stop2.mp3      # Stop announcement 2
    └── ...                  # Other stop announcements
```

## Video Files

### Required Video Files

1. **`prayagwelcome.mp4`**: Welcome video shown at app startup
2. **`v1.mp4`**: First music video in rotation
3. **`v2.mp4`**: Second music video in rotation
4. **`v3.mp4`**: Third music video in rotation

### Video Specifications

- **Format**: MP4 (H.264 video, AAC audio)
- **Resolution**: 1920x1080 (Full HD)
- **Aspect Ratio**: 16:9
- **Duration**: Varies (typically 30 seconds to 5 minutes)
- **File Size**: Optimize for TV playback (typically < 50MB per video)

### Video Playback Cycle

The app plays videos in the following sequence:
1. Welcome video (`prayagwelcome.mp4`)
2. Advertisement video (from API or local file)
3. Music video 1 (`v1.mp4`)
4. Advertisement video
5. Music video 2 (`v2.mp4`)
6. Advertisement video
7. Music video 3 (`v3.mp4`)
8. Repeat cycle

## Audio Files

### Required Audio Files

1. **`audio_03_r1_45.mp3`**: Fallback announcement audio
2. **Stop-specific audio files**: Named as `audio_{stopId}.mp3`

### Audio Specifications

- **Format**: MP3
- **Sample Rate**: 44.1 kHz
- **Bit Rate**: 128 kbps or higher
- **Channels**: Stereo or Mono
- **Duration**: Typically 3-10 seconds per announcement

### Audio Naming Convention

Audio files should be named according to the stop ID:
- `audio_03_r1_45.mp3` for stop ID "03_r1_45"
- `audio_stop123.mp3` for stop ID "stop123"
- `audio_central_station.mp3` for stop ID "central_station"

## Adding New Media Files

### Adding Videos

1. Place video file in `assets/videos/` directory
2. Update `video-manager.js` if adding new video types
3. Ensure video meets specifications above

### Adding Audio Announcements

1. Place audio file in `assets/audio/` directory
2. Name file according to stop ID convention
3. Test audio playback in app

## File Management

### Optimization Tips

1. **Compress videos**: Use tools like FFmpeg to optimize file sizes
2. **Optimize audio**: Ensure MP3 files are properly encoded
3. **Test playback**: Verify all media files play correctly on WebOS TV

### Backup

- Keep original high-quality files as backup
- Use compressed versions for app deployment
- Maintain version control for media updates

## Troubleshooting

### Video Issues

- **Video not playing**: Check file format and codec compatibility
- **Poor quality**: Ensure video meets resolution requirements
- **Large file size**: Compress video while maintaining quality

### Audio Issues

- **Audio not playing**: Verify MP3 format and file path
- **Missing announcements**: Check audio file naming convention
- **Poor audio quality**: Ensure proper MP3 encoding

## Development Notes

- Media files are not included in version control due to size
- Place sample media files for development
- Update this README when adding new media types
- Test all media files on actual WebOS TV hardware
