def khan_h264_view(khanpath=''): path = split_khanpath(khanpath) tree = get_tree() filename = khan.getfile(tree, path) filename = os.path.splitext(filename)[0] + '.m4v' khan_webm_dir = config().get_path('VIDEO', 'khan_h264_dir') r = send_file(os.path.abspath(os.path.join(khan_webm_dir, filename)), mimetype='video/mp4') return make_response(r, 200, {'Accept-Ranges': 'bytes'})
def khan_webm_view(khanpath=''): print "webm_view", khanpath path = split_khanpath(khanpath) tree = get_tree() filename = khan.getfile(tree, path) khan_webm_dir = config().get_path('VIDEO', 'khan_webm_dir') r = send_file(os.path.abspath(os.path.join(khan_webm_dir, filename))) return make_response(r, 200, {'Accept-Ranges': 'bytes'})