Skip to content

kaltura-vpaas/webcasting-app-python

Repository files navigation

webcasting-integration-python

This is a sample Python app that demonstrates how to integrate the Kaltura Webcasting tool into your application. It includes event creation, working with metadata, launching the Kaltura Webcasting Studio, and most importantly, playing the webcast stream using the Kaltura Player.

The complete documentation can be found here.

Setting Up The Application

  • Make sure you have Python 3 installed.
  • Install or import the Kaltura Client Library
  • Run pip install -r requirements.txt from within the project directory to install all dependencies.

Copy config.template.py onto config.py and set the below values

  • partner_id (int): this can be found in the integration settings

  • admin_secret (string): this can be found in the integration settings

  • admin_email (string): the email address of the admin, most likely the account owner, used for object creation

  • service_url (string): Kaltura API endpoint ("https://www.kaltura.com/" for SaaS)

  • use_v2_player (boolean): determines whether the application will use the v2 player for playback - in the scenario that presentation slides are required in the live stream

  • uiconf_id (int): the ID of the v7 player to be used for playback. Can be found in the KMC TV STUDIO (can be left blank if use_v2_player is set to True)

  • uiconf_idv2 (int): the ID of the v2 player to be used for playback. Can be found in the KMC Universal STUDIO. (Can be left blank if use_v2_player is set to False)

  • win_uiconf_id (int): the ID of the UIConf if the webcast application is launched on a Windows machine.

  • mac_uiconf_id (int): the ID of the UIConf if the webcast application is launched on a Mac machine.

  • viewer_user_id (string) = the identifying string of the end user who will be watching the stream. This value will most likely will come from a different part of the application

  • broadcaster_user (string) = the identifying string of the broadcaster of the stream

  • broadcaster_display_name (string) = the name that is displayed for the broadcaster in Webcast Studio

  • moderator_user (string) = the identifying string of the moderator who will be managing the Q&A flow

  • app_name (string) = the name that appears on the Webcasting Studio App

  • app_id (string) = application ID (used for analytics)

  • app_domain (string) = domain name of the application

Running The Application

python3 main.py

To use with Python 2.7, change the import statement in view.py from:

from urllib.parse import urlencode

to:

from urllib import urlencode

About The Application

main.py

main.py contains the application routes. /create creates a new webcasting entry and returns webpage with options for the entry. /view takes the entry ID as a parameter and returns a webpage with the Kaltura Player embedded. /moderator takes the entry ID as a parameter and returns the URL for the moderator view.

create.py

A webcast instance is created using the configurations discussed in the guide and an Admin Kaltura Session. Metadata profiles are populated with webcast and event data. Links for downloading the Webcasting Studio are retrieved and displayed. The parameters for launching the application are populated and passed in the response.

view.py

playback() accepts an entry ID and checks whether it is live. If not, livestream.redirectEntryId and livestream.recordedEntryId are checked. If those members are also empty, the media API service is called to locate any recordings that were created from the live entry ID in question. If found, the entry ID is replaced. Otherwise, the entry ID remains the same.

A user session is created and passed in the response, along with other values needed in order to embed the player with the live entry.

moderator_view() takes the entry ID and creates a Kaltura Session (KS) that allows for moderation on the entry. The necessary parameters are encoded and added to the moderator view URL which is returned in the response.

About

sample app for webcasting integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published