Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

fix(CAMERA_STREAM): support non-HLS-capable devices #537

Merged
merged 1 commit into from
Nov 24, 2020

Conversation

difelice
Copy link
Contributor

Non HLS compatible devices, like old generation iPads, could try to "stream" video using internal browser capabilities, like Safari in iOS.

Camera Stream not working on legacy iPad:
image

Using video tag attributes directly works:
image

Example config:

{
  position: [0, 0],
  width: 3,
  height: 2,
  bgSize: "cover",
  state: false,
  type: TYPES.CAMERA_THUMBNAIL,
  refresh: 5000,
  id: "camera.backyard",
  fullscreen: {
    type: TYPES.CAMERA_STREAM,
    noHls: true,
    objFit: "contain",
    id: "camera.backyard",
    bufferLength: 5,
  },
}

@rchl
Copy link
Collaborator

rchl commented Nov 23, 2020

I feel like HLS script itself should handle that. Either through feature detection or user-agent sniffing. Have you tried raising this as an issue on their repo (https://github.com/video-dev/hls.js)?

@rchl
Copy link
Collaborator

rchl commented Nov 23, 2020

Actually, in their code example, they are checking support with Hls.isSupported(). So it's likely that we should do the same instead of introducing an option.

@difelice difelice force-pushed the no-hls-option branch 2 times, most recently from 6917d69 to 81ddcdb Compare November 23, 2020 21:03
@difelice difelice changed the title Add noHls option for Camera Stream Support non HLS capable devices for Camera Stream Nov 23, 2020
@resoai
Copy link
Collaborator

resoai commented Nov 23, 2020

A separate issue with HLS we have is that pausing the stream is not implemented when page is changed or screensaver starts.

https://github.com/resoai/TileBoard/blob/master/scripts/directives.js#L217

scripts/directives.js Outdated Show resolved Hide resolved
@difelice difelice force-pushed the no-hls-option branch 2 times, most recently from 7a6fd16 to c6b829d Compare November 24, 2020 14:47
@difelice
Copy link
Contributor Author

Actually, in their code example, they are checking support with Hls.isSupported(). So it's likely that we should do the same instead of introducing an option.

Added check and works as expected. Thanks
image

@rchl rchl marked this pull request as ready for review November 24, 2020 16:07
@rchl rchl changed the title Support non HLS capable devices for Camera Stream fix(CAMERA_STREAM): support non-HLS-capable devices Nov 24, 2020
@rchl rchl merged commit 7bbeb3c into resoai:master Nov 24, 2020
@rchl
Copy link
Collaborator

rchl commented Nov 24, 2020

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants