Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 36 lines (25 sloc) 0.82 kb
da02eb1 @tinabeans first real commit... a bunch of new code now exists, yay
authored
1 import flask
2 from lib import OpenTokSDK
3
4 # OpenTok setup
5 api_key = "6303111"
6 api_secret = "45b94b30d4f5554ad7445950c13e8d78e099e92e"
7
8 opentok_sdk = OpenTokSDK.OpenTokSDK(api_key, api_secret)
9
250eef9 @tinabeans got video working again! yay
authored
10 session_address = "68.175.75.213"
da02eb1 @tinabeans first real commit... a bunch of new code now exists, yay
authored
11 session_properties = {
12 OpenTokSDK.SessionProperties.p2p_preference: "enabled"
13 }
14
15 session = opentok_sdk.create_session(session_address, session_properties)
16 token = opentok_sdk.generate_token(session.session_id)
17
18
19 #create a new Flask object
20 app = flask.Flask(__name__)
21
22
23 # used to pass OpenTok setup info to template
24 content = {
25 'apiKey' : session.session_id,
26 'sessionId' : session.session_id,
27 'token' : token
28 }
29
30 @app.route('/p2ptest')
31 def p2pTest():
32 return flask.render_template('_test_p2p.html', content=content)
33
34
35 if __name__ == '__main__':
36 app.run(host='0.0.0.0', port=7777, debug=True)
Something went wrong with that request. Please try again.