Commit 43b041df authored by Madi Baig's avatar Madi Baig
Browse files

Added imperial_panopto api package with example route

parent 30ac3b78
Pipeline #212596 failed with stages
in 1 minute and 49 seconds
......@@ -39,6 +39,14 @@ from blueprints.auth import auth_blueprint
app.register_blueprint(home_blueprint)
app.register_blueprint(auth_blueprint)
# Setup panopto api
import imperial_panopto
imperial_panopto.set_panopto_api_client_id("YOUR_CLIENT_ID_HERE")
imperial_panopto.set_panopto_api_client_secret("YOUR_CLIENT_SECRET_HERE")
imperial_panopto.set_app_name(app)
if ENV == 'prod':
imperial_panopto.set_panopto_is_dev(False)
app.register_blueprint(imperial_panopto.panopto_api_blueprint)
# Hook any custom Jinja templating functions
from config import CUSTOM_TEMPLATE_FUNCTIONS
......
from flask import Blueprint, render_template, request, redirect
from imperial_panopto.auth import panopto_login_required
from imperial_panopto.videos import search_videos, SortField, SortOrder
from config import url_for2
from database.db import db
from models.entity import Entity
......@@ -22,6 +25,13 @@ def dashboard(materials_client, user):
return render_template('dashboard.html', user=user, my_courses=my_courses)
@home_blueprint.route('/panopto_example')
@panopto_login_required
def panopto_example():
videos = search_videos("Test", sort_field=SortField.Name, sort_order=SortOrder.Asc, page_number=0)
return videos[0].build_iframe()
@home_blueprint.route('/entities', methods=['GET', 'POST'])
@login_required
def entities(user):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment