fix: player issues
This commit is contained in:
@@ -165,7 +165,7 @@ func (ctl *posts) Play(ctx fiber.Ctx, id int64, user *model.Users) (*PlayUrl, er
|
||||
}
|
||||
|
||||
for _, asset := range post.Assets.Data {
|
||||
if asset.Type == "video/mp4" && asset.Metas.Short == preview {
|
||||
if asset.Type == "video/mp4" && asset.Metas != nil && asset.Metas.Short == preview {
|
||||
media, err := models.Medias.GetByID(ctx.Context(), asset.Media)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -50,7 +50,8 @@ const loadVideoSource = async () => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load video:', error)
|
||||
// alert('视频加载失败,请稍后重试')
|
||||
alert('视频加载失败: ' + error.response.data)
|
||||
await player.value.stop()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user