feat&fix: add task recording endpoint, enhance video player support, and improve mobile responsiveness
This commit is contained in:
@@ -208,6 +208,20 @@ def task_screenshot(task_type, task_id, filename):
|
||||
else:
|
||||
return "Screenshot does not exist", 404
|
||||
|
||||
@app.route('/task/<task_type>/<task_id>/recording')
|
||||
def task_recording(task_type, task_id):
|
||||
"""Get task recording video"""
|
||||
recording_path = os.path.join(RESULTS_BASE_PATH, task_type, task_id, "recording.mp4")
|
||||
if os.path.exists(recording_path):
|
||||
response = send_file(recording_path, mimetype='video/mp4')
|
||||
# Add headers to improve mobile compatibility
|
||||
response.headers['Accept-Ranges'] = 'bytes'
|
||||
response.headers['Cache-Control'] = 'public, max-age=3600'
|
||||
response.headers['X-Content-Type-Options'] = 'nosniff'
|
||||
return response
|
||||
else:
|
||||
return "Recording does not exist", 404
|
||||
|
||||
@app.route('/api/task/<task_type>/<task_id>')
|
||||
def api_task_detail(task_type, task_id):
|
||||
"""Task detail API"""
|
||||
|
||||
Reference in New Issue
Block a user