8000 Dev by Qsnh · Pull Request #201 · Qsnh/meedu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Dev #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 9, 2021
Merged

Dev #201

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/Http/Controllers/Api/V2/OtherController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public function __construct(ConfigServiceInterface $configService)
* @apiSuccess {Object} data 数据
* @apiSuccess {String} data.webname 网站名
* @apiSuccess {String} data.url 网站地址
* @apiSuccess {String} data.pc_url PC网站地址
* @apiSuccess {String} data.h5_url H5网站地址
* @apiSuccess {String} data.icp ICP备案号
* @apiSuccess {String} data.user_protocol 用户协议URL
* @apiSuccess {String} data.user_private_protocol 用户隐私协议URL
Expand Down Expand Up @@ -65,6 +67,8 @@ public function config(Addons $addons)
'webname' => $this->configService->getName(),
// 网站地址
'url' => trim($this->configService->getUrl(), '/'),
'pc_url' => trim($this->configService->getPcUrl(), '/'),
'h5_url' => trim($this->configService->getH5Url(), '/'),
// ICP备案
'icp' => $this->configService->getIcp(),
'icp_link' => $this->configService->getIcpLink(),
Expand Down
2 changes: 1 addition & 1 deletion app/Meedu/MeEdu.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@

class MeEdu
{
const VERSION = 'v4.5';
const VERSION = 'v4.5.1';
}
15 changes: 13 additions & 2 deletions app/Services/Base/Services/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,24 @@ public function getUrl(): string
return config('app.url');
}

public function getTencentVodTranscodeFormat(): string
public function getTencentVodTranscodeFormat(): array
{
return config('tencent.vod.transcode_format', '');
$format = strtolower(config('tencent.vod.transcode_format', ''));
return $format ? explode(',', $format) : [];
}

public function getTencentSms(): array
{
return config('sms.gateways.tencent');
}

public function getPcUrl(): string
{
return config('meedu.system.pc_url');
}

public function getH5Url(): string
{
return config('meedu.system.h5_url');
}
}
6 changes: 2 additions & 4 deletions app/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,11 @@ function get_tencent_play_url(string $vid): array
if ($response->MediaInfoSet[0]->TranscodeInfo) {
// 配置了转码信息
$urls = [];
$supportFormat = $configService->getTencentVodTranscodeFormat();
foreach ($response->MediaInfoSet[0]->TranscodeInfo->TranscodeSet as $item) {
$url = $item->Url;
$format = strtolower(pathinfo($url, PATHINFO_EXTENSION));
if (
$configService->getTencentVodTranscodeFormat() &&
$format !== $configService->getTencentVodTranscodeFormat()
) {
if ($supportFormat && !in_array($format, $supportFormat)) {
// 限定转码格式,只能使用一种
continue;
}
Expand Down
6 changes: 6 additions & 0 deletions config/meedu.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@
// 播放器封面
'player_thumb' => '/images/player-thumb.png',

// PC网站地址
'pc_url' => '',

// H5网站地址
'h5_url' => '',

// 播放器
'player' => [
// 跑马灯
Expand Down
2 changes: 1 addition & 1 deletion config/tencent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'app_id' => '',
'secret_id' => '',
'secret_key' => '',
'transcode_format' => env('TENCENT_VOD_TRANSCODE_FORMAT', 'm3u8'),
'transcode_format' => '',
],
'wechat' => [
'mini' => [
Expand Down
28 changes: 28 additions & 0 deletions database/seeders/AppConfigSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ public function run()
'default_value' => '',
'key' => 'app.url',
'value' => '',
'help' => '请填写API服务访问地址',
],
[
'group' => '系统',
'name' => 'PC网站地址',
'field_type' => 'text',
'sort' => 1,
'default_value' => '',
'key' => 'meedu.system.pc_url',
'value' => '',
],
[
'group' => '系统',
'name' => 'H5网站地址',
'field_type' => 'text',
'sort' => 1,
'default_value' => '',
'key' => 'meedu.system.h5_url',
'value' => '',
],
[
'group' => '系统',
Expand Down Expand Up @@ -751,6 +770,15 @@ public function run()
' 62DF ;value' => '',
'is_private' => 1,
],
[
'group' => '视频',
'name' => '腾讯云播放格式',
'field_type' => 'text',
'sort' => 10,
'key' => 'tencent.vod.transcode_format',
'value' => '',
'help' => '默认支持所有格式,如果配置mp4则只支持mp4,多个请用英文逗号连接',
],

// 会员配置
[
Expand Down
0