A Unity package that enables displaying Google Slides presentations and YouTube videos in VR using WebView technology. Perfect for VR presentations, training sessions, and interactive learning environments.
- Display Google Slides presentations in VR
- Play YouTube videos in VR
- Interactive URL input system
- XR Interaction Toolkit integration
- Grabbable and interactive WebView display
- Multiplayer-ready
- Optimized for VR performance
- Unity 2022.3 or later
- XR Interaction Toolkit 2.5.0 or later
- XR Management 4.3.0 or later
- TextMeshPro 3.0.0 or later
- Input System 1.7.0 or later
- A WebView plugin (recommended: UniWebView)
- Open Unity Package Manager (Window > Package Manager)
- Click the + button in the top-left corner
- Select "Add package from git URL"
- Enter:
https://github.com/rohansonawane/unity-webview.git
- Download this repository
- Extract it into your project's
Packagesfolder - Add required dependencies through the Package Manager
- Create a new scene or open an existing one
- Add XR Origin to your scene if not present
- Right-click in Hierarchy > VRWebView > WebView Display
- Configure the WebView settings in the inspector:
- Set default URL (Google Slides or YouTube)
- Adjust WebView dimensions
- Configure interaction settings
// Attach this script to any GameObject
public class WebViewExample : MonoBehaviour
{
[SerializeField] private VRWebView webView;
void Start()
{
// Load a Google Slides presentation
webView.LoadUrl("https://docs.google.com/presentation/d/YOUR_PRESENTATION_ID");
}
}// Example of loading a YouTube video
webView.LoadUrl("https://www.youtube.com/watch?v=VIDEO_ID");- Simple WebView display setup
- URL input demonstration
- Basic interaction example
- Synchronized WebView across multiple users
- Shared control demonstration
- Network state management
public class CustomWebViewValidator : MonoBehaviour
{
[SerializeField] private VRWebView webView;
public bool ValidateUrl(string url)
{
// Add your custom validation logic
return url.Contains("docs.google.com") ||
url.Contains("youtube.com");
}
}- Grab to move
- Pointer interaction
- Distance-based interaction
- Scale adjustment
-
Performance
- Keep WebView resolution reasonable
- Use proper culling settings
- Implement lazy loading when possible
-
Security
- Validate URLs before loading
- Implement proper access controls in multiplayer
- Use HTTPS URLs only
-
User Experience
- Provide clear loading indicators
- Implement error handling
- Add user feedback for interactions
-
WebView Not Displaying
- Check if WebView plugin is properly installed
- Verify URL format is correct
- Check console for error messages
-
Performance Issues
- Reduce WebView resolution
- Check for memory leaks
- Verify graphics settings
-
Interaction Problems
- Verify XR Interaction Toolkit setup
- Check interaction layers
- Validate input system configuration
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This package is licensed under the MIT License. See the LICENSE file for details.
For issues and feature requests, please use the GitHub issues page.