streamlit-funplayer


Namestreamlit-funplayer JSON
Version 0.1.37 PyPI version JSON
download
home_pageNone
SummaryStreamlit wrapper for funplayer-react component for synchronized media and haptic playback
upload_time2025-07-20 10:47:19
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseCC-BY-NC-SA-4.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Streamlit FunPlayer

A modern React component for synchronized media and haptic playback with professional-grade performance and VR support.

[![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![Streamlit](https://img.shields.io/badge/streamlit-1.45+-red.svg)](https://streamlit.io)
[![React](https://img.shields.io/badge/react-18.3+-blue.svg)](https://reactjs.org)

## Overview

FunPlayer is a versatile in-browser media player based on Video.js that synchronizes audio/video content with haptic feedback devices through the Buttplug.io ecosystem. Built with modern React architecture and optimized for real-time performance, it supports everything from simple media playback to complex multi-channel haptic orchestration.

**Key Differentiators:**
- ๐ŸŽฏ **React-first architecture** 100% JS/React, this Streamlit component being provided as a convenience wrapper for Python integration
- โšก **120Hz haptic refresh rate** with optimized interpolation caching
- ๐Ÿฅฝ **Native VR support** (Quest, Pico) via browser with Intiface sideload
- ๐Ÿ”ง **Modular design** - autonomous managers with event-driven communication
- ๐ŸŽฎ **100+ device compatibility** through Buttplug.io and Intiface Central ecosystem
- ๐ŸŽจ **Professional UI** with real-time visualization and adaptive theming

## Quick Start

### Installation

```bash
pip install streamlit-funplayer
```

### Basic Usage

```python
import streamlit as st
from streamlit_funplayer import funplayer

# Simple video with haptic synchronization + custom theme
funplayer(
    playlist=[{
        'sources': [{'src': 'video.mp4', 'type': 'video/mp4'}],
        'funscript': {'actions': [{"at": 0, "pos": 0}, {"at": 1000, "pos": 100}, ...]},
        'name': 'Demo Scene'
    }],
    theme={
        'primaryColor': '#FF6B6B',
        'backgroundColor': '#1E1E1E'
    }
)
```

## Features

### ๐ŸŽฌ Universal Media Support

**Formats & Protocols:**
- **Video:** MP4, WebM, MOV, AVI, MKV, M4V
- **Audio:** MP3, WAV, OGG, M4A, AAC, FLAC  
- **Streaming:** HLS (m3u8), DASH (mpd), direct URLs
- **VR:** 360ยฐ/180ยฐ content with WebXR integration
- **Haptic-only:** Timeline playback without media

**Smart Playlists:**
- Auto-progression with seamless transitions
- Mixed content types (video + audio + haptic-only)
- Poster generation and metadata handling

### ๐ŸŽฎ Advanced Haptic System

**Device Integration:**
- **Buttplug.io ecosystem** - 100+ supported devices
- **Auto-discovery** and intelligent capability mapping
- **Multi-actuator support** (vibration, linear, rotation, oscillation)
- **Virtual device mode** for development without hardware

**Real-time Performance:**
- **120Hz update rate** with adaptive throttling
- **Interpolation caching** for smooth seeking
- **Sub-millisecond timing** accuracy for VR applications
- **Memory-optimized** processing for long sessions

**Professional Controls:**
- **Per-channel configuration** (scale, offset, range, invert)
- **Global modulation** with real-time adjustment
- **Multi-channel funscripts** with automatic routing
- **Live visualization** with customizable waveforms

### ๐Ÿฅฝ VR & Cross-Platform

**VR Optimization:**
- **Meta Quest native** (via Intiface Central sideload)
- **Browser-based** - zero app store friction
- **90Hz display + 120Hz haptic** synchronized rendering
- **Memory management** optimized for sustained VR sessions

**Platform Support:**
- **Desktop:** Windows, macOS, Linux
- **Mobile:** iOS, Android browsers  
- **VR Headsets:** Quest 2/3/Pro, Pico, any WebXR device
- **HTTPS required** for device access in production

## API Reference

### Core Function

```python
funplayer(
    playlist: Optional[List[Dict[str, Any]]] = None,
    theme: Optional[Dict[str, Any]] = None,
    key: Optional[str] = None
) -> Any
```

### Playlist Item Format

The playlist parameter is an optional list of dict items. The playlist item format follows Video.js format with additional haptic integration via the funscript parameter. Multiple sources can be provided for a single item to allow the user or the player to select the quality of the playback (480p, 720p, 1080p, etc.) depending on the bandwith available. 

```python
{
    'sources': [                        # Media sources (Video.js format)
        {
            'src': 'video_480p.mp4',    # URL / Local file / BytesIO
            'type': 'video/mp4',        # MIME type (optional, auto-detected)
            'label': '480p'             # Quality label (optional)
        },
        {
            'src': 'video_720p.mp4',    # Alternate quality
            'type': 'video/mp4',       
            'label': '720p'             
        }
    ],
    'funscript': funscript,             # Haptic data / URL / Local file / BytesIO
    'name': str,                        # Display title
    'description': str,                 # Description (optional)
    'poster': str,                      # Poster image URL (optional)
    'duration': float,                  # Duration in seconds (optionnal)
    'textTracks': list                  # Subtitles/captions (optional)
}
```

### Theme Parameters

The `theme` parameter accepts a dictionary with the following optional keys:

```python
theme = {
    # Colors
    'primaryColor': '#FF4B4B',                      # Primary accent color
    'backgroundColor': '#FFFFFF',                   # Main background
    'secondaryBackgroundColor': '#F0F2F6',          # Secondary background
    'textColor': '#262730',                         # Text color
    'borderColor': '#E6EBF5',                       # Border and divider color
    
    # Typography & Layout
    'fontFamily': '"Source Sans Pro", sans-serif',    # Font family
    'baseRadius': '0.5rem',                           # Border radius
    'spacing': '1rem',                                # Base spacing unit
    
    # Base theme (optional)
    'base': 'dark'                                    # Predefined theme base
}
```

## Architecture

### Design Philosophy

FunPlayer uses a **modular, event-driven architecture** where independent managers handle specific domains without tight coupling. **FunPlayerCore** serves as the central hub, coordinating between business logic managers and UI components through a unified event bus.

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                            UI (React)                           โ”‚
โ”‚                    FunPlayer (Main UI Component)                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  MediaPlayer    โ”‚ โ”‚ HapticSettings  โ”‚ โ”‚ HapticVisualizerโ”‚    โ”‚
โ”‚  โ”‚   (Video.js)    โ”‚ โ”‚   (Controls)    โ”‚ โ”‚    (Canvas)     โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚            โ”‚                   โ”‚                   โ”‚            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚                   โ”‚                   โ”‚
             โ”‚                   โ”‚                   โ”‚         
             โ”‚                   โ”‚                   โ”‚          
             โ–ผ                   โ–ผ                   โ–ผ          
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                          FunPlayerCore                          โ”‚
โ”‚                                                                 โ”‚
โ”‚                 Event Bus + State Coordination                  โ”‚
โ”‚                                                                 โ”‚
โ”‚        โ€ข notify() system        โ€ข Lazy manager getters          โ”‚
โ”‚        โ€ข Event routing          โ€ข Lifecycle management          โ”‚
โ”‚        โ€ข State synchronization  โ€ข Error handling                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ–ฒ                    โ–ฒ                   โ–ฒ         
             โ”‚                    โ”‚                   โ”‚           
             โ”‚                    โ”‚                   โ”‚          
             โ”‚                    โ”‚                   โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚            โ”‚                    โ”‚                   โ”‚           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚ ButtPlugManager โ”‚ โ”‚FunscriptManager โ”‚ โ”‚ PlaylistManager โ”‚    โ”‚
โ”‚  โ”‚                 โ”‚ โ”‚                 โ”‚ โ”‚                 โ”‚    โ”‚
โ”‚  โ”‚ โ€ข Device comms  โ”‚ โ”‚ โ€ข Multi-channel โ”‚ โ”‚ โ€ข Content mgmt  โ”‚    โ”‚
โ”‚  โ”‚ โ€ข Auto-mapping  โ”‚ โ”‚ โ€ข Interpolation โ”‚ โ”‚ โ€ข Format valid  โ”‚    โ”‚
โ”‚  โ”‚ โ€ข Capabilities  โ”‚ โ”‚ โ€ข Channel types โ”‚ โ”‚ โ€ข Navigation    โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                 โ”‚
โ”‚                    Business Logic Managers                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Core Components

**FunPlayerCore**: Central singleton orchestrating manager communication through event bus

**ButtPlugManager**: Device communication, capability detection, command optimization

**FunscriptManager**: Multi-channel parsing, intelligent interpolation, auto-mapping

**PlaylistManager**: Content validation, format normalization, navigation

**MediaPlayer**: Video.js integration with playlist extensions and VR support

## System Requirements

### Software Dependencies

**Required:**
- Python 3.9+ with pip
- Streamlit 1.45+ for component API compatibility
- Modern browser with WebSocket and WebXR support
- [Intiface Central](https://intiface.com/central/) for device connectivity

**Development:**
- Node.js 18+ for frontend development
- npm or yarn for dependency management

### Hardware Compatibility

**Haptic Devices:**
- 100+ devices via Buttplug.io ecosystem
- USB and Bluetooth connectivity
- Multi-actuator devices supported
- Virtual device simulation available

**VR Headsets:**
- Meta Quest 2/3/Pro (tested, optimized)
- Pico 4/4E, ByteDance devices
- Any WebXR-compatible headset
- Desktop VR via browser

## Development

### Frontend Development

The React component can be developed independently:

```bash
cd streamlit_funplayer/frontend
npm install
npm start  # Development server on localhost:3001
```

### Production Build

```bash
cd streamlit_funplayer/frontend
npm run build  # Creates optimized build/

# Switch to production mode
# Edit streamlit_funplayer/__init__.py: _RELEASE = True
```

### Testing

```bash
# Component testing
streamlit run funplayer.py

# End-to-end testing
python -m pytest e2e/
```

## Performance Optimizations

- **Interpolation caching** with smart invalidation
- **Throttled device commands** to prevent flooding  
- **Memory management** for long VR sessions
- **Bundle optimization** via Vite with tree-shaking
- **Adaptive quality** based on system capabilities

## Use Cases

### Entertainment & Content Creation
- Adult content platforms with synchronized haptic feedback
- VR experiences with enhanced tactile immersion
- Music and rhythm games with haptic enhancement
- Interactive storytelling with physical feedback

### Research & Development  
- Haptic perception and HCI research
- Multi-modal interface prototyping
- Therapeutic applications with controlled feedback
- Educational tools with enhanced sensory learning

### Accessibility
- Haptic substitution for audio content (hearing impaired)
- Customizable intensity for different user needs
- Multi-modal feedback for enhanced accessibility

## Contributing

We welcome contributions from the community! Please follow existing architectural patterns and test thoroughly with both virtual and real devices.

**Focus Areas:**
- Device compatibility and testing
- Performance optimizations for high-frequency updates
- Additional funscript format support
- Enhanced visualization and debugging tools

## License

**Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International**

For commercial licensing, contact: **bferrand.math@gmail.com**

## Acknowledgments

Built on the excellent work of:
- **[Buttplug.io](https://buttplug.io)** - Universal haptic device protocol
- **[Intiface](https://intiface.com)** - Desktop bridge application  
- **[Video.js](https://videojs.com)** - Robust media player framework
- **[Streamlit](https://streamlit.io)** - Python web app framework
- **Funscript community** - Haptic scripting standards and content

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "streamlit-funplayer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Baptiste Ferrand <bferrand.math@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/3e/92/346d8cddadeaf4c6261cc5dc9884bba1227a90614b0199dec364aa786c31/streamlit_funplayer-0.1.37.tar.gz",
    "platform": null,
    "description": "# Streamlit FunPlayer\n\nA modern React component for synchronized media and haptic playback with professional-grade performance and VR support.\n\n[![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)\n[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)\n[![Streamlit](https://img.shields.io/badge/streamlit-1.45+-red.svg)](https://streamlit.io)\n[![React](https://img.shields.io/badge/react-18.3+-blue.svg)](https://reactjs.org)\n\n## Overview\n\nFunPlayer is a versatile in-browser media player based on Video.js that synchronizes audio/video content with haptic feedback devices through the Buttplug.io ecosystem. Built with modern React architecture and optimized for real-time performance, it supports everything from simple media playback to complex multi-channel haptic orchestration.\n\n**Key Differentiators:**\n- \ud83c\udfaf **React-first architecture** 100% JS/React, this Streamlit component being provided as a convenience wrapper for Python integration\n- \u26a1 **120Hz haptic refresh rate** with optimized interpolation caching\n- \ud83e\udd7d **Native VR support** (Quest, Pico) via browser with Intiface sideload\n- \ud83d\udd27 **Modular design** - autonomous managers with event-driven communication\n- \ud83c\udfae **100+ device compatibility** through Buttplug.io and Intiface Central ecosystem\n- \ud83c\udfa8 **Professional UI** with real-time visualization and adaptive theming\n\n## Quick Start\n\n### Installation\n\n```bash\npip install streamlit-funplayer\n```\n\n### Basic Usage\n\n```python\nimport streamlit as st\nfrom streamlit_funplayer import funplayer\n\n# Simple video with haptic synchronization + custom theme\nfunplayer(\n    playlist=[{\n        'sources': [{'src': 'video.mp4', 'type': 'video/mp4'}],\n        'funscript': {'actions': [{\"at\": 0, \"pos\": 0}, {\"at\": 1000, \"pos\": 100}, ...]},\n        'name': 'Demo Scene'\n    }],\n    theme={\n        'primaryColor': '#FF6B6B',\n        'backgroundColor': '#1E1E1E'\n    }\n)\n```\n\n## Features\n\n### \ud83c\udfac Universal Media Support\n\n**Formats & Protocols:**\n- **Video:** MP4, WebM, MOV, AVI, MKV, M4V\n- **Audio:** MP3, WAV, OGG, M4A, AAC, FLAC  \n- **Streaming:** HLS (m3u8), DASH (mpd), direct URLs\n- **VR:** 360\u00b0/180\u00b0 content with WebXR integration\n- **Haptic-only:** Timeline playback without media\n\n**Smart Playlists:**\n- Auto-progression with seamless transitions\n- Mixed content types (video + audio + haptic-only)\n- Poster generation and metadata handling\n\n### \ud83c\udfae Advanced Haptic System\n\n**Device Integration:**\n- **Buttplug.io ecosystem** - 100+ supported devices\n- **Auto-discovery** and intelligent capability mapping\n- **Multi-actuator support** (vibration, linear, rotation, oscillation)\n- **Virtual device mode** for development without hardware\n\n**Real-time Performance:**\n- **120Hz update rate** with adaptive throttling\n- **Interpolation caching** for smooth seeking\n- **Sub-millisecond timing** accuracy for VR applications\n- **Memory-optimized** processing for long sessions\n\n**Professional Controls:**\n- **Per-channel configuration** (scale, offset, range, invert)\n- **Global modulation** with real-time adjustment\n- **Multi-channel funscripts** with automatic routing\n- **Live visualization** with customizable waveforms\n\n### \ud83e\udd7d VR & Cross-Platform\n\n**VR Optimization:**\n- **Meta Quest native** (via Intiface Central sideload)\n- **Browser-based** - zero app store friction\n- **90Hz display + 120Hz haptic** synchronized rendering\n- **Memory management** optimized for sustained VR sessions\n\n**Platform Support:**\n- **Desktop:** Windows, macOS, Linux\n- **Mobile:** iOS, Android browsers  \n- **VR Headsets:** Quest 2/3/Pro, Pico, any WebXR device\n- **HTTPS required** for device access in production\n\n## API Reference\n\n### Core Function\n\n```python\nfunplayer(\n    playlist: Optional[List[Dict[str, Any]]] = None,\n    theme: Optional[Dict[str, Any]] = None,\n    key: Optional[str] = None\n) -> Any\n```\n\n### Playlist Item Format\n\nThe playlist parameter is an optional list of dict items. The playlist item format follows Video.js format with additional haptic integration via the funscript parameter. Multiple sources can be provided for a single item to allow the user or the player to select the quality of the playback (480p, 720p, 1080p, etc.) depending on the bandwith available. \n\n```python\n{\n    'sources': [                        # Media sources (Video.js format)\n        {\n            'src': 'video_480p.mp4',    # URL / Local file / BytesIO\n            'type': 'video/mp4',        # MIME type (optional, auto-detected)\n            'label': '480p'             # Quality label (optional)\n        },\n        {\n            'src': 'video_720p.mp4',    # Alternate quality\n            'type': 'video/mp4',       \n            'label': '720p'             \n        }\n    ],\n    'funscript': funscript,             # Haptic data / URL / Local file / BytesIO\n    'name': str,                        # Display title\n    'description': str,                 # Description (optional)\n    'poster': str,                      # Poster image URL (optional)\n    'duration': float,                  # Duration in seconds (optionnal)\n    'textTracks': list                  # Subtitles/captions (optional)\n}\n```\n\n### Theme Parameters\n\nThe `theme` parameter accepts a dictionary with the following optional keys:\n\n```python\ntheme = {\n    # Colors\n    'primaryColor': '#FF4B4B',                      # Primary accent color\n    'backgroundColor': '#FFFFFF',                   # Main background\n    'secondaryBackgroundColor': '#F0F2F6',          # Secondary background\n    'textColor': '#262730',                         # Text color\n    'borderColor': '#E6EBF5',                       # Border and divider color\n    \n    # Typography & Layout\n    'fontFamily': '\"Source Sans Pro\", sans-serif',    # Font family\n    'baseRadius': '0.5rem',                           # Border radius\n    'spacing': '1rem',                                # Base spacing unit\n    \n    # Base theme (optional)\n    'base': 'dark'                                    # Predefined theme base\n}\n```\n\n## Architecture\n\n### Design Philosophy\n\nFunPlayer uses a **modular, event-driven architecture** where independent managers handle specific domains without tight coupling. **FunPlayerCore** serves as the central hub, coordinating between business logic managers and UI components through a unified event bus.\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                            UI (React)                           \u2502\n\u2502                    FunPlayer (Main UI Component)                \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u2502\n\u2502  \u2502  MediaPlayer    \u2502 \u2502 HapticSettings  \u2502 \u2502 HapticVisualizer\u2502    \u2502\n\u2502  \u2502   (Video.js)    \u2502 \u2502   (Controls)    \u2502 \u2502    (Canvas)     \u2502    \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2502\n\u2502            \u2502                   \u2502                   \u2502            \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n             \u2502                   \u2502                   \u2502\n             \u2502                   \u2502                   \u2502         \n             \u2502                   \u2502                   \u2502          \n             \u25bc                   \u25bc                   \u25bc          \n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                          FunPlayerCore                          \u2502\n\u2502                                                                 \u2502\n\u2502                 Event Bus + State Coordination                  \u2502\n\u2502                                                                 \u2502\n\u2502        \u2022 notify() system        \u2022 Lazy manager getters          \u2502\n\u2502        \u2022 Event routing          \u2022 Lifecycle management          \u2502\n\u2502        \u2022 State synchronization  \u2022 Error handling                \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n             \u25b2                    \u25b2                   \u25b2         \n             \u2502                    \u2502                   \u2502           \n             \u2502                    \u2502                   \u2502          \n             \u2502                    \u2502                   \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502            \u2502                    \u2502                   \u2502           \u2502\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u2502\n\u2502  \u2502 ButtPlugManager \u2502 \u2502FunscriptManager \u2502 \u2502 PlaylistManager \u2502    \u2502\n\u2502  \u2502                 \u2502 \u2502                 \u2502 \u2502                 \u2502    \u2502\n\u2502  \u2502 \u2022 Device comms  \u2502 \u2502 \u2022 Multi-channel \u2502 \u2502 \u2022 Content mgmt  \u2502    \u2502\n\u2502  \u2502 \u2022 Auto-mapping  \u2502 \u2502 \u2022 Interpolation \u2502 \u2502 \u2022 Format valid  \u2502    \u2502\n\u2502  \u2502 \u2022 Capabilities  \u2502 \u2502 \u2022 Channel types \u2502 \u2502 \u2022 Navigation    \u2502    \u2502\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2502\n\u2502                                                                 \u2502\n\u2502                    Business Logic Managers                      \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n### Core Components\n\n**FunPlayerCore**: Central singleton orchestrating manager communication through event bus\n\n**ButtPlugManager**: Device communication, capability detection, command optimization\n\n**FunscriptManager**: Multi-channel parsing, intelligent interpolation, auto-mapping\n\n**PlaylistManager**: Content validation, format normalization, navigation\n\n**MediaPlayer**: Video.js integration with playlist extensions and VR support\n\n## System Requirements\n\n### Software Dependencies\n\n**Required:**\n- Python 3.9+ with pip\n- Streamlit 1.45+ for component API compatibility\n- Modern browser with WebSocket and WebXR support\n- [Intiface Central](https://intiface.com/central/) for device connectivity\n\n**Development:**\n- Node.js 18+ for frontend development\n- npm or yarn for dependency management\n\n### Hardware Compatibility\n\n**Haptic Devices:**\n- 100+ devices via Buttplug.io ecosystem\n- USB and Bluetooth connectivity\n- Multi-actuator devices supported\n- Virtual device simulation available\n\n**VR Headsets:**\n- Meta Quest 2/3/Pro (tested, optimized)\n- Pico 4/4E, ByteDance devices\n- Any WebXR-compatible headset\n- Desktop VR via browser\n\n## Development\n\n### Frontend Development\n\nThe React component can be developed independently:\n\n```bash\ncd streamlit_funplayer/frontend\nnpm install\nnpm start  # Development server on localhost:3001\n```\n\n### Production Build\n\n```bash\ncd streamlit_funplayer/frontend\nnpm run build  # Creates optimized build/\n\n# Switch to production mode\n# Edit streamlit_funplayer/__init__.py: _RELEASE = True\n```\n\n### Testing\n\n```bash\n# Component testing\nstreamlit run funplayer.py\n\n# End-to-end testing\npython -m pytest e2e/\n```\n\n## Performance Optimizations\n\n- **Interpolation caching** with smart invalidation\n- **Throttled device commands** to prevent flooding  \n- **Memory management** for long VR sessions\n- **Bundle optimization** via Vite with tree-shaking\n- **Adaptive quality** based on system capabilities\n\n## Use Cases\n\n### Entertainment & Content Creation\n- Adult content platforms with synchronized haptic feedback\n- VR experiences with enhanced tactile immersion\n- Music and rhythm games with haptic enhancement\n- Interactive storytelling with physical feedback\n\n### Research & Development  \n- Haptic perception and HCI research\n- Multi-modal interface prototyping\n- Therapeutic applications with controlled feedback\n- Educational tools with enhanced sensory learning\n\n### Accessibility\n- Haptic substitution for audio content (hearing impaired)\n- Customizable intensity for different user needs\n- Multi-modal feedback for enhanced accessibility\n\n## Contributing\n\nWe welcome contributions from the community! Please follow existing architectural patterns and test thoroughly with both virtual and real devices.\n\n**Focus Areas:**\n- Device compatibility and testing\n- Performance optimizations for high-frequency updates\n- Additional funscript format support\n- Enhanced visualization and debugging tools\n\n## License\n\n**Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International**\n\nFor commercial licensing, contact: **bferrand.math@gmail.com**\n\n## Acknowledgments\n\nBuilt on the excellent work of:\n- **[Buttplug.io](https://buttplug.io)** - Universal haptic device protocol\n- **[Intiface](https://intiface.com)** - Desktop bridge application  \n- **[Video.js](https://videojs.com)** - Robust media player framework\n- **[Streamlit](https://streamlit.io)** - Python web app framework\n- **Funscript community** - Haptic scripting standards and content\n",
    "bugtrack_url": null,
    "license": "CC-BY-NC-SA-4.0",
    "summary": "Streamlit wrapper for funplayer-react component for synchronized media and haptic playback",
    "version": "0.1.37",
    "project_urls": {
        "Homepage": "https://github.com/B4PT0R/funplayer",
        "Repository": "https://github.com/B4PT0R/funplayer"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7f59c38cf3aba02246f1a60c8218893fd4e3dc91526309ec370160e14e607153",
                "md5": "645fed627bc721febb47fd5e4f9ba27b",
                "sha256": "276fab210cb895cc2cd6e6f750b5dfe3901cbc28e0ac5db4fe3a42347605a6fb"
            },
            "downloads": -1,
            "filename": "streamlit_funplayer-0.1.37-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "645fed627bc721febb47fd5e4f9ba27b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 783791,
            "upload_time": "2025-07-20T10:47:15",
            "upload_time_iso_8601": "2025-07-20T10:47:15.976839Z",
            "url": "https://files.pythonhosted.org/packages/7f/59/c38cf3aba02246f1a60c8218893fd4e3dc91526309ec370160e14e607153/streamlit_funplayer-0.1.37-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3e92346d8cddadeaf4c6261cc5dc9884bba1227a90614b0199dec364aa786c31",
                "md5": "97d710ffb249e307c8d328c3d3db3c3a",
                "sha256": "dee27317a0caadb7ad1a393f6e738bc188d3887e3ccb0cbfe48c44ea80e5d5df"
            },
            "downloads": -1,
            "filename": "streamlit_funplayer-0.1.37.tar.gz",
            "has_sig": false,
            "md5_digest": "97d710ffb249e307c8d328c3d3db3c3a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 789759,
            "upload_time": "2025-07-20T10:47:19",
            "upload_time_iso_8601": "2025-07-20T10:47:19.034164Z",
            "url": "https://files.pythonhosted.org/packages/3e/92/346d8cddadeaf4c6261cc5dc9884bba1227a90614b0199dec364aa786c31/streamlit_funplayer-0.1.37.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-20 10:47:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "B4PT0R",
    "github_project": "funplayer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "streamlit-funplayer"
}
        
Elapsed time: 2.02453s