Prepare 2 (or more) Android devices. One device is Gear VR compatible and another one is controller.
These devices have to be in the same local network.
- Create your osig files.
- Put your osig files into
gearvr/src/main/assets/
directory. - Open project with Android Studio.
- Build.
- Run gearvr module with Gear VR device and controller module with other Android device.
Put multiview-files.txt
in controller's root storage directory (/sdcard/).
File paths are written in each lines. Example:
Oculus/360Videos/video.mp4
Oculus/360Videos/other-video.mp4
Oculus/360Videos/another-video.mp4
- Gear VR : Broadcast own IP address to network by UDP
- Controller : Receive broadcast and establish WebSocket connection to IP address
- Gear VR : On receive WebSocket request, stop broadcasting
- Controller : Send media information by WebSocket
- Gear VR : Receive media information and process (load, seek, play and pause).
- Controller : Shutdown. Close WebSocket connection
- return to 1.
Configurations are in common/src/main/res/values/common_config.xml
<resources>
<integer name="broadcast_port">50122</integer>
<integer name="websocket_port">50123</integer>
<string name="websocket_protocol">vrmultiview</string>
</resources>
UDP broadcast port. UDP Broadcast is used in device searching phase. Gear VR sends its IP address, WebSocket port, and protocol at regular intervals by UDP broadcast. When controller receives this packet, controller will create WebSocket connection to Gear VR. Broadcast message is a JSON string which represents GearVRDeviceInfo object. This can be changed independently from websocket_port.
WebSocket port. WebSocket is used to control Gear VR from controller. WebSocket message is a JSON string which represents ControlMessage object. This can be changed independently from broadcast_port.
WebSocket protocol can be changed to any string. Change this to prevent connection from malicious programs.
Icons are licensed by Creative Commons 3.0 https://creativecommons.org/licenses/by/3.0/us/
Controller app icon https://thenounproject.com/esteves_emerick
Gear VR app icon https://thenounproject.com/Aliriza/