feat: 添加媒体播放功能,支持基于短时效token的播放入口及相关API接口
This commit is contained in:
@@ -37,8 +37,8 @@ type ContentDetail struct {
|
||||
type ContentAssetsResponse struct {
|
||||
// Content is the content entity.
|
||||
Content *models.Content `json:"content,omitempty"`
|
||||
// Assets is the list of media assets for the requested role (preview/main).
|
||||
Assets []*models.MediaAsset `json:"assets,omitempty"`
|
||||
// Assets is the list of playable assets for the requested role (preview/main).
|
||||
Assets []*ContentPlayableAsset `json:"assets,omitempty"`
|
||||
// PreviewSeconds indicates the max preview duration (only meaningful for preview response).
|
||||
PreviewSeconds int32 `json:"preview_seconds,omitempty"`
|
||||
}
|
||||
|
||||
23
backend/app/http/tenant/dto/content_asset_play.go
Normal file
23
backend/app/http/tenant/dto/content_asset_play.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"quyun/v2/pkg/consts"
|
||||
)
|
||||
|
||||
// ContentPlayableAsset is a deliverable media asset item with short-lived play URL/token.
|
||||
type ContentPlayableAsset struct {
|
||||
AssetID int64 `json:"asset_id"`
|
||||
Type consts.MediaAssetType `json:"type"`
|
||||
|
||||
// PlayURL is a short-lived URL; do NOT expose bucket/object_key directly.
|
||||
PlayURL string `json:"play_url"`
|
||||
|
||||
// ExpiresAt indicates when PlayURL/token expires; optional.
|
||||
ExpiresAt *time.Time `json:"expires_at,omitempty"`
|
||||
|
||||
// Meta is a display-safe whitelist (currently passthrough JSON); optional.
|
||||
Meta json.RawMessage `json:"meta,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user