Skip to main content

Comprehensive Python integration for Jitsi Meet with video conferencing, audio calls, broadcasting, and VOD

Project description

Jitsi Plus Plugin

PyPI version Python versions License Documentation Status

A comprehensive Python integration for Jitsi Meet with video conferencing, audio calls, broadcasting, and video-on-demand capabilities. This plugin provides a complete solution for building real-time communication applications.

Features

  • Video Conferencing

    • Host-configurable room size
    • Enable/disable video, audio, chat, and screen sharing
    • Whiteboard functionality
    • Polls and Q&A
    • Background customization
    • Settings management
  • Audio Calls

    • Host-configurable room size
    • Enable/disable features
    • Chat integration
    • Poll functionality
  • Broadcasting

    • Live streaming with RTMP/HLS
    • Host controls
    • Chat integration
    • Recording capabilities
    • Scales to millions of viewers
  • Video on Demand (VOD)

    • Video player
    • URL-based playback
    • Advertisement support (pre-roll, mid-roll, post-roll)
    • High scalability (10M+ users)

Installation

# Basic installation
pip install jitsi-plus-plugin

# With all extras
pip install jitsi-plus-plugin[all]

# With specific features
pip install jitsi-plus-plugin[media,scaling]

Quick Start

Basic Video Call

from jitsi_plus_plugin import JitsiPlusPlugin

# Initialize the plugin
plugin = JitsiPlusPlugin()
plugin.initialize()

# Create a video call
call_info = plugin.video_call.create_call({
    "max_participants": 10,
    "features": {
        "video": True,
        "audio": True,
        "chat": True,
        "whiteboard": True
    }
})

print(f"Video call created: {call_info['id']}")
print(f"Join URL: {call_info['jitsi_url']}")

Setting Up a Broadcast

from jitsi_plus_plugin import JitsiPlusPlugin

# Initialize the plugin
plugin = JitsiPlusPlugin()
plugin.initialize()

# Create a broadcast
broadcast = plugin.broadcast.create_broadcast("My Broadcast", {
    "max_hosts": 3,
    "features": {
        "chat": True,
        "screen_sharing": True
    }
})

# Start broadcasting
plugin.broadcast.start_broadcast(broadcast["id"])

print(f"Broadcast URL: {broadcast['hls_url']}")

Video on Demand with Ads

from jitsi_plus_plugin import JitsiPlusPlugin

# Initialize the plugin
plugin = JitsiPlusPlugin()
plugin.initialize()

# Create VOD entry
vod = plugin.vod.create_vod_entry("My Video", "/path/to/video.mp4")

# Configure ads
plugin.vod.configure_ad_settings(vod["id"], {
    "pre_roll": ["https://example.com/ads/pre_roll.mp4"],
    "mid_roll": [
        {"time": 300, "url": "https://example.com/ads/mid_roll1.mp4"},
        {"time": 600, "url": "https://example.com/ads/mid_roll2.mp4"}
    ],
    "post_roll": ["https://example.com/ads/post_roll.mp4"]
})

# Get player configuration
player_config = plugin.vod.create_player_config(vod_id=vod["id"])
print(player_config)

Complete Example

import asyncio
import logging
from jitsi_plus_plugin import JitsiPlusPlugin

# Configure logging
logging.basicConfig(level=logging.INFO)

# Plugin configuration
config = {
    "jitsi": {
        "server_url": "https://meet.jit.si",
        "room_prefix": "jitsi-plus-"
    },
    "media_server": {
        "server_url": "https://media.example.com",
        "rtmp_port": 1935
    },
    "signaling": {
        "host": "0.0.0.0",
        "port": 8080
    }
}

# Initialize the plugin
plugin = JitsiPlusPlugin(config)
plugin.initialize()

# Create a video call
video_call = plugin.video_call.create_call({
    "max_participants": 10,
    "features": {
        "video": True,
        "audio": True,
        "chat": True,
        "whiteboard": True,
        "polls": True
    }
})

print(f"Video call created: {video_call['id']}")
print(f"Jitsi URL: {video_call['jitsi_url']}")

# Join the call as host
host = plugin.video_call.join_call(
    video_call["id"], 
    "Host User", 
    {"features": {"screen_sharing": True}}
)

# Enable whiteboard
plugin.whiteboard.create_whiteboard(video_call["id"])

# Create a poll
poll = plugin.polls.create_poll(
    video_call["id"],
    "What feature do you like the most?",
    ["Video", "Audio", "Chat", "Whiteboard", "Polls"],
    host["id"]
)

# Run the plugin (this will block)
try:
    # Keep the main thread alive
    asyncio.get_event_loop().run_forever()
except KeyboardInterrupt:
    # Shutdown on Ctrl+C
    plugin.shutdown()

Framework Integration

Django Integration

# settings.py
INSTALLED_APPS = [
    # ...
    'jitsi_plus_plugin.integrations.django',
    # ...
]

JITSI_PLUS_CONFIG = {
    "jitsi": {
        "server_url": "https://meet.jit.si"
    },
    # More configuration...
}

Flask Integration

from flask import Flask
from jitsi_plus_plugin.integrations.flask import init_jitsi_plus

app = Flask(__name__)
jitsi_plus = init_jitsi_plus(app, {
    "jitsi": {
        "server_url": "https://meet.jit.si"
    }
})

@app.route('/create-meeting')
def create_meeting():
    meeting = jitsi_plus.video_call.create_call()
    return {"meeting_url": meeting["jitsi_url"]}

FastAPI Integration

from fastapi import FastAPI
from jitsi_plus_plugin.integrations.fastapi import JitsiPlusRouter

app = FastAPI()
jitsi_router = JitsiPlusRouter({
    "jitsi": {
        "server_url": "https://meet.jit.si"
    }
})

app.include_router(jitsi_router, prefix="/api/jitsi")

Advanced Configuration

The plugin provides extensive configuration options to customize behavior for different environments and use cases.

config = {
    "jitsi": {
        "server_url": "https://meet.jit.si",
        "room_prefix": "jitsi-plus-",
        "use_ssl": True
    },
    "media_server": {
        "server_url": "https://media.example.com",
        "rtmp_port": 1935,
        "hls_segment_duration": 4,
        "recording_enabled": True,
        "recording_directory": "/var/recordings"
    },
    "signaling": {
        "host": "0.0.0.0",
        "port": 8080,
        "use_ssl": True,
        "ssl_cert": "/path/to/cert.pem",
        "ssl_key": "/path/to/key.pem"
    },
    "scaling": {
        "auto_scaling": True,
        "max_participants_per_server": 100,
        "monitor_interval_seconds": 30
    },
    "features": {
        "whiteboard_enabled": True,
        "polls_enabled": True,
        "chat_enabled": True,
        "recording_enabled": True,
        "transcription_enabled": False
    }
}

Authentication & Security

The plugin supports various authentication methods to secure your communications:

# JWT authentication
from jitsi_plus_plugin.utils.auth import generate_jwt_token

token = generate_jwt_token({
    "room": "*",
    "user": {
        "name": "John Doe",
        "email": "john@example.com",
        "avatar": "https://example.com/avatar.jpg"
    },
    "exp": int(time.time()) + 86400  # 24 hours
}, "your-secret-key")

# Use token for authentication
plugin = JitsiPlusPlugin({
    "jitsi": {
        "server_url": "https://meet.jit.si",
        "jwt_token": token
    }
})

Command Line Interface

The package includes a command-line interface for common operations:

# Create a video call
jitsi-plus create-call --max-participants 10 --features video audio chat

# Start a broadcast
jitsi-plus create-broadcast "Weekly Update" --record

# List active calls
jitsi-plus list-calls

# Start a media server
jitsi-plus start-media-server

Cloud Deployment

The plugin supports deployment to various cloud providers:

from jitsi_plus_plugin.utils.cloud import deploy_to_aws

# Deploy to AWS
deployment = deploy_to_aws({
    "region": "us-west-2",
    "instance_type": "t3.large",
    "scaling": {
        "min_instances": 1,
        "max_instances": 10,
        "target_cpu_utilization": 70
    }
})

Scaling to Millions

For large-scale deployments, use the scaling utilities:

from jitsi_plus_plugin.utils.scaling import setup_scaling

# Configure scaling for 10M+ users
scaling_config = setup_scaling({
    "media_servers": {
        "initial_count": 3,
        "max_count": 20,
        "auto_scale": True
    },
    "jitsi_servers": {
        "initial_count": 5,
        "max_count": 30,
        "auto_scale": True
    },
    "cdn_integration": {
        "provider": "cloudfront",
        "distribution_id": "E1EXAMPLE"
    }
})

Contributing

Contributions are welcome! Here's how you can contribute:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request

Please make sure to update tests as appropriate.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Developed by Kumar Abhishek (@Kabhishek18)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jitsi_plus_plugin-4.2.0.tar.gz (49.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jitsi_plus_plugin-4.2.0-py3-none-any.whl (59.1 kB view details)

Uploaded Python 3

File details

Details for the file jitsi_plus_plugin-4.2.0.tar.gz.

File metadata

  • Download URL: jitsi_plus_plugin-4.2.0.tar.gz
  • Upload date:
  • Size: 49.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jitsi_plus_plugin-4.2.0.tar.gz
Algorithm Hash digest
SHA256 db8bf44015b453360407790565199c95445099550a4eff03c632ba3eb32f58aa
MD5 f2d17fda373e006fa0ee75a33c24271c
BLAKE2b-256 4c6748616e4fe27e15122b6f40d437940f86f639f17917d74a7dcf3e868cae7a

See more details on using hashes here.

File details

Details for the file jitsi_plus_plugin-4.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jitsi_plus_plugin-4.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d29e58c18b6f7fe64bb9b0f10ec6c4a417cefeec96f33f70cb28aaf09a9ce56
MD5 9aa6acdc4002aea8f5dca45e931c8013
BLAKE2b-256 d02de1712e5c9079eb792b81c6719ecf69cfa6c1f9d0e1f4328f42977f1be05e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page