I have a server in python to process an id (the id of youtube video), this is the code:
class MessageHandler(tornado.web.RequestHandler):
def get(self, action_id):
print "Message = " + action_id
if action_id == "id":
for ws in opened_ws:
ws.write_message("ID: " + action_id)
return render_template('js/player.js', action_id=json.dumps(action_id))
(...)
I use the return render_template to pass "action_id" to player.js, which is a function to process films using the API from Youtube, the code is :
var PushPlayer = (function () {
var player = null;
function new_player() {
player = new YT.Player('yt-player', {
videoId: action_id,
}
});
}
(...)
With action_id
, i can have everything id of youtube's video.. but i don't know who pass the action_id
from python to javascript..any idea?
Thanks!