From 07bd873683c32268619ba0bd0ae19658716e3623 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Mar 2020 01:11:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=9C=B0=E5=9D=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/videos/_video.json.jbuilder | 2 +- .../weapps/courses/course_videos.json.jbuilder | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/views/users/videos/_video.json.jbuilder b/app/views/users/videos/_video.json.jbuilder index 707c0a5cf..5dd472f27 100644 --- a/app/views/users/videos/_video.json.jbuilder +++ b/app/views/users/videos/_video.json.jbuilder @@ -1,4 +1,4 @@ -json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_id, :transcoded +json.extract! video, :id, :title, :cover_url, :vv, :user_id, :transcoded json.play_url url_base64_encode(video.play_url) json.file_url url_base64_encode(video.file_url) json.play_duration video.video_play_duration diff --git a/app/views/weapps/courses/course_videos.json.jbuilder b/app/views/weapps/courses/course_videos.json.jbuilder index bca028c47..12e1d514c 100644 --- a/app/views/weapps/courses/course_videos.json.jbuilder +++ b/app/views/weapps/courses/course_videos.json.jbuilder @@ -1,4 +1,15 @@ json.count @count json.videos @videos do |video| - json.partial! 'users/videos/video', locals: { video: video } + #json.partial! 'users/videos/video', locals: { video: video } + json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_id, :transcoded + #json.play_url url_base64_encode(video.play_url) + #json.file_url url_base64_encode(video.file_url) + json.play_duration video.video_play_duration + json.published_at video.display_published_at + json.created_at video.display_created_at + json.updated_at video.display_updated_at + user = video.user + json.user_name user&.real_name + json.user_img url_to_avatar(user) + json.user_login user&.login end \ No newline at end of file