VR_TRIP is a distributed virtual reality video player that enables synchronized 360° video playback across multiple Android devices over local or remote networks. The application creates a shared immersive experience where one device acts as a master controller while multiple client devices follow in perfect synchronization.
- Developers: Mobile app developers working with VR content, socket programming, and distributed systems
- Technical Integrators: Teams implementing VR solutions for enterprise or educational environments
- Content Creators: VR content producers looking to deliver synchronized group experiences
- System Administrators: IT professionals deploying VR solutions in controlled environments
- End Users: Tour guides, educators, and VR enthusiasts seeking collaborative viewing experiences
- Educational Tours: Virtual museum visits, historical site explorations, and immersive learning experiences
- Training Programs: Synchronized VR training sessions for multiple participants
- Entertainment: Group VR movie watching and gaming experiences
- Remote Collaboration: Distributed teams exploring 3D models and virtual environments
- Medical Training: Synchronized medical procedure simulations and anatomy lessons
- Real Estate: Virtual property tours for multiple potential buyers
VR_TRIP implements a client-server architecture using TCP socket connections for real-time communication and synchronization.
┌─────────────────┐ ┌─────────────────┐
│ Manager │◄────────┤ Client 1 │
│ (Server) │ │ │
│ Port: 50000 │ └─────────────────┘
│ │ ┌─────────────────┐
│ │◄────────┤ Client 2 │
│ │ │ │
│ │ └─────────────────┘
│ │ ┌─────────────────┐
│ │◄────────┤ Client N │
└─────────────────┘ └─────────────────┘
- Protocol: TCP sockets for reliable message delivery
- Port: 50000 (configurable)
- Message Format: JSON-based command structure
- Discovery: Android Network Service Discovery (NSD) using "_vrmd360._tcp" service type
- Fallback: Manual IP address entry for direct connections
- Runs socket server on port 50000
- Maintains client connection registry
- Controls video playback state
- Broadcasts synchronization commands
- Manages video content selection
- Handles timeline marker synchronization
- Establishes TCP connection to manager
- Receives and executes playback commands
- Maintains synchronization with manager timeline
- Automatically reconnects on connection loss
- Reports connection status to manager
- 360° Video Support: Full spherical video rendering using MD360Player4Android
- Stereoscopic Support: Side-by-side and top-bottom 3D formats
- Multiple Display Modes:
- Touch navigation
- Motion tracking for VR headsets
- Cardboard-compatible rendering
- Video Formats: MP4, WebM, and other ExoPlayer-supported formats
- Resolution Support: Up to 4K 360° video content
- Real-time Command Broadcasting: Instant propagation of play/pause/seek commands
- Timeline Markers: JSON-based transcript system for guided synchronization points
- Automatic Reconnection: Smart handling of temporary network disconnections
- State Synchronization: New clients automatically sync to current playback state
- Precision Control: Millisecond-level synchronization accuracy
- Network Service Discovery (NSD): Automatic discovery of manager devices on local network
- Service Broadcasting: Manager devices announce availability using "_vrmd360._tcp" service type
- Manual Connection: Direct IP address entry for remote connections
- Device Naming: Configurable device names for easy identification
- Connection Status: Real-time connection monitoring and status reporting
- Primary: Android (API 21+)
- Future Roadmap: iOS compatibility planned
- VR Rendering: MD360Player4Android for 360° video processing
- Media Playback: ExoPlayer for robust video handling
- UI Framework: Native Android with Material Design components
- Network Discovery: Android NSD (Network Service Discovery)
- Cloud Integration: Google Drive API for content distribution
- File Management: Android Storage Access Framework
- Implementation: Native Java/Android socket programming
- Protocol: TCP sockets for reliable communication
- JSON Processing: Native Android JSON parsing
- Threading: AsyncTask and Handler-based socket management
- Android Studio 4.0 or higher
- Android SDK API 21 or higher
- Google Services JSON configuration file
- Android device with gyroscope (recommended for VR features)
-
Clone Repository
git clone [repository-url] cd VrMd360Player -
Google Services Setup
- Place
google-services.jsoninapp/src/directory - Ensure Google Drive API is enabled in Google Console
- Place
-
Build Application
./gradlew assembleDebug
-
Install on Devices
adb install app/build/outputs/apk/debug/app-debug.apk
- Socket Port: Configurable in app settings (default: 50000)
- Device Name: User-configurable in settings
- Content Directory:
/Downloads/VR_TRIP/for external content - Internal Storage: App-specific directory for imported videos
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />All socket communications use JSON format with the following structure:
{
"action": "command_name",
"payload": "optional_data"
}// Play Command
{
"action": "play",
"payload": ""
}
// Pause Command
{
"action": "pause",
"payload": ""
}
// Seek Command
{
"action": "seek",
"payload": "12345" // Position in milliseconds
}
// Video Selection
{
"action": "load_video",
"payload": "video_filename.mp4"
}// Client Connection
{
"action": "client_connect",
"payload": "device_name"
}
// Client Disconnection
{
"action": "client_disconnect",
"payload": "device_name"
}
// Heartbeat
{
"action": "ping",
"payload": ""
}// Timeline Sync
{
"action": "sync_timeline",
"payload": "enabled" // "enabled" or "disabled"
}
// Position Update
{
"action": "position_update",
"payload": "12345" // Current position in milliseconds
}- Connection Loss: Automatic reconnection with exponential backoff
- Invalid Commands: Graceful error logging without app termination
- Network Timeouts: 30-second timeout with retry mechanism
- Malformed JSON: Error logging and command skipping
- File Not Found: User notification and fallback to available content
- Immersive Design: Minimal UI overlay for maximum VR immersion
- Auto-hide Controls: Playback controls disappear during viewing
- Touch Activation: Tap screen to reveal control overlay
- Spherical Navigation: 360° touch-based camera control
- VR Mode Toggle: Switch between normal and cardboard viewing modes
- Device Management Panel: Real-time display of connected clients
- Video Library Browser: Grid view of available VR content
- Playback Controls: Standard play/pause/seek controls with sync options
- Timeline Management: Toggle for automatic pause at transcript markers
- Connection Status: Visual indicators for network and client status
- Connection Screen: Manager discovery and manual connection options
- Sync Indicator: Visual feedback for synchronization status
- Minimal Player: Streamlined interface focused on content consumption
- Status Overlay: Non-intrusive connection and sync status display
- Video selection and playback control
- Timeline scrubbing and seeking
- Client device management
- Sync mode toggle (timeline markers)
- Connection monitoring
- Manager selection and connection
- VR viewing mode selection
- Basic playback information display
- Connection status monitoring
- Platform Support: Android only (iOS planned for future release)
- Network Dependency: Requires stable network connection for synchronization
- Video Format Limitations: Limited to ExoPlayer-supported formats
- Concurrent Client Limit: Practical limit of 10-15 simultaneous clients
- File Size Restrictions: Large video files may impact sync performance
- Network Bandwidth: 360° video requires significant bandwidth for streaming
- Device Performance: VR rendering demands high-performance devices
- Battery Consumption: Extended VR sessions drain battery quickly
- Memory Usage: High-resolution 360° content requires substantial RAM
- iOS Version: Native iOS client development
- WebRTC Integration: Improved network performance and NAT traversal
- Cloud Streaming: Direct cloud video streaming without local storage
- Enhanced Sync Algorithms: Machine learning-based sync optimization
- Multi-language Support: Internationalization for global deployment
- Advanced Analytics: Usage tracking and performance monitoring
# Unit Tests
./gradlew testDebugUnitTest
# Integration Tests
./gradlew connectedAndroidTest- Multi-device Setup: Test with 3+ devices in various network conditions
- Sync Accuracy Testing: Use stopwatch to verify millisecond-level sync
- Network Stress Testing: Simulate network interruptions and recovery
- Performance Testing: Monitor CPU/memory usage during VR playback
- Android Emulator: Use network conditioning tools
- Physical Testing: Test across different Wi-Fi networks and mobile data
- Proxy Tools: Use Charles Proxy or similar for network simulation
- Bandwidth Limiting: Test with throttled connections
// In MainActivity or Application class
if (BuildConfig.DEBUG) {
SocketManager.setDebugMode(true);
}- Socket Events: Connection, disconnection, and command transmission
- Sync Events: Timeline synchronization and marker events
- Performance Metrics: Latency measurements and frame rate monitoring
- Error Tracking: Network errors, parsing failures, and recovery actions
- Android Studio Debugger: Real-time socket connection monitoring
- Network Inspector: HTTP/Socket traffic analysis
- Custom Debug Panel: In-app network statistics and connection status
- Remote Logging: Centralized logging for multi-device debugging
# ADB commands for testing
adb logcat | grep "VR_TRIP" # View app-specific logs
adb shell dumpsys connectivity # Network connectivity status
adb shell am start -n com.vrtrip/.MainActivity # Launch appThis project is distributed under the [LICENSE_TYPE] license. See the LICENSE file for complete terms and conditions.
- Commercial Use: [Specify if allowed]
- Modification Rights: [Specify permissions]
- Distribution Terms: [Specify requirements]
- Attribution Requirements: [Specify if needed]
- Search Existing Issues: Check GitHub issues before creating new ones
- Issue Template: Use provided templates for bug reports and feature requests
- Reproduction Steps: Include detailed steps to reproduce issues
- Environment Details: Specify device models, Android versions, and network conditions
- Fork Repository: Create personal fork for development
- Feature Branches: Use descriptive branch names for new features
- Code Standards: Follow Android development best practices
- Testing Requirements: Include unit tests for new functionality
- Pull Request Process: Submit PR with detailed description and testing results
- Java: Follow Google Java Style Guide
- XML: Use consistent indentation and attribute ordering
- Comments: Document complex socket communication logic
- Naming: Use descriptive names for socket events and methods
# Install development dependencies
./gradlew build
# Run code quality checks
./gradlew checkstyle
./gradlew findbugs
# Format code
./gradlew formatCode- GitHub Issues: Primary support channel for bug reports and feature requests
- Developer Email: [developer-email@domain.com]
- Documentation Wiki: [link-to-wiki] for additional technical details
- Community Forum: [link-to-forum] for user discussions and use cases
For users wanting to get started quickly:
- Install the app on all devices (one manager, multiple clients)
- Configure device names in Settings
- Start Manager on the controlling device
- Connect Clients by discovering or entering manager IP
- Load Content using the File Manager
- Begin Playback and enjoy synchronized VR experiences
For detailed setup instructions, refer to Section 5: Setup and Installation.
Last Updated: [Current Date]
Version: [App Version]
Documentation Version: 1.0