Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
10cac36b
Commit
10cac36b
authored
Jun 15, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
0ead0b38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
ClassRoomController.cs
Edu.WebApi/Controllers/Course/ClassRoomController.cs
+2
-0
VideoController.cs
Edu.WebApi/Controllers/Video/VideoController.cs
+48
-0
No files found.
Edu.WebApi/Controllers/Course/ClassRoomController.cs
View file @
10cac36b
...
...
@@ -133,6 +133,8 @@ namespace Edu.WebApi.Controllers.Course
{
extModel
.
RoomPicList
=
new
List
<
string
>();
}
extModel
.
EndTime
=
extModel
.
EndTime
??
"09:30"
;
extModel
.
StartTime
=
extModel
.
StartTime
??
"21:30"
;
return
ApiResult
.
Success
(
data
:
extModel
);
}
...
...
Edu.WebApi/Controllers/Video/VideoController.cs
View file @
10cac36b
...
...
@@ -71,5 +71,53 @@ namespace Edu.WebApi.Controllers.Video
return
ApiResult
.
Failed
(
"获取失败"
);
}
}
/// <summary>
/// 获取播放地址
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetPlayInfo
()
{
JObject
jobj
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
string
VideoId
=
jobj
.
GetStringValue
(
"strVid"
);
try
{
string
regionId
=
"cn-shanghai"
;
IClientProfile
profile
=
DefaultProfile
.
GetProfile
(
regionId
,
"LTAI5tBoku6yPFSkacA3sbAT"
,
"zcjzTpMGyPwchaKAyUFeKNEBcqAxvL"
);
var
acsClient
=
new
Aliyun
.
Acs
.
Core
.
DefaultAcsClient
(
profile
);
if
(
string
.
IsNullOrEmpty
(
VideoId
))
{
return
ApiResult
.
Failed
(
"获取失败"
);
}
GetPlayInfoRequest
request
=
new
GetPlayInfoRequest
();
request
.
VideoId
=
VideoId
;
// 初始化客户端
// DefaultAcsClient client = InitVodClient();
// 发起请求,并得到 response
GetPlayInfoResponse
response
=
acsClient
.
GetAcsResponse
(
request
);
List
<
GetPlayInfoResponse
.
GetPlayInfo_PlayInfo
>
playInfoList
=
response
.
PlayInfoList
;
GetPlayInfoResponse
.
GetPlayInfo_VideoBase
videoBase
=
response
.
VideoBase
;
if
(
playInfoList
.
Count
>
0
)
{
return
ApiResult
.
Success
(
""
,
new
{
URL
=
playInfoList
[
0
].
PlayURL
,
VideoImg
=
videoBase
.
CoverURL
});
}
else
{
return
ApiResult
.
Failed
(
"获取失败"
);
}
}
catch
(
Exception
)
{
return
ApiResult
.
Failed
(
"获取失败"
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment