fix: ios player
This commit is contained in:
@@ -82,7 +82,6 @@ func (c *Controller) MediaIndex(ctx fiber.Ctx) error {
|
||||
if claim == nil {
|
||||
return errorx.RequestUnAuthorized
|
||||
}
|
||||
|
||||
// c.Locals(consts.CtxKeyJwt, token)
|
||||
token := fiber.Locals[string](ctx, consts.CtxKeyJwt)
|
||||
model, err := c.svc.GetMediaByHash(ctx.Context(), claim.TenantID, hash)
|
||||
@@ -103,6 +102,7 @@ func (c *Controller) MediaIndex(ctx fiber.Ctx) error {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx.Set("Content-Type", "application/vnd.apple.mpegurl")
|
||||
return ctx.SendString(playlist.String())
|
||||
}
|
||||
|
||||
@@ -133,6 +133,7 @@ func (c *Controller) MediaSegment(ctx fiber.Ctx) error {
|
||||
}
|
||||
|
||||
filepath := c.svc.GetSegmentPath(ctx.Context(), mediaType, model.TenantID, model.Hash, segments[0])
|
||||
ctx.Set("Content-Type", "video/mp2t")
|
||||
return ctx.SendFile(filepath)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user