fix: play segments
This commit is contained in:
@@ -279,7 +279,7 @@ func (svc *Service) Upsert(ctx context.Context, tenantId int64, item media_store
|
||||
}
|
||||
|
||||
// get video m3u8
|
||||
func (svc *Service) GetM3U8(ctx context.Context, tenantId int64, types pg.MediaType, hash string, bought bool) (m3u8.Playlist, error) {
|
||||
func (svc *Service) GetM3U8(ctx context.Context, tenantId int64, types pg.MediaType, hash string, bought bool, token string) (m3u8.Playlist, error) {
|
||||
log := svc.log.WithField("method", "GetM3U8")
|
||||
indexPath := filepath.Join(svc.storageConfig.Path, fmt.Sprintf("%d", tenantId), hash, types.String(), "index.m3u8")
|
||||
log.Infof("m3u8 path: %s", indexPath)
|
||||
@@ -335,6 +335,9 @@ func (svc *Service) GetM3U8(ctx context.Context, tenantId int64, types pg.MediaT
|
||||
return nil, errors.Wrap(err, "encode hash id")
|
||||
}
|
||||
seg.URI = fmt.Sprintf("%s/%s.%s", types, hashID, ext)
|
||||
if token != "" {
|
||||
seg.URI += fmt.Sprintf("?token=%s", token)
|
||||
}
|
||||
}
|
||||
|
||||
return media, nil
|
||||
|
||||
Reference in New Issue
Block a user