Detect if HEVC video is playable in Safari

How can you detect if an HEVC video track in an HLS stream is playable in Safari, in a similar way that iOS devices can find out using AVFoundation "isPlayable"?


https://developer.apple.com/videos/play/wwdc2017/503/

In this talk @24:07 from WWDC, the speaker says that the method isPlayable on AVFoundation will answer if the video is suitable for playback on the current device, which indicates that the user will experience smooth playback of the video without significant power cost for videos with extended durations.


We want to find out the same thing but in a Safari runtime. Or just find out if the device has support for hardware decode of HEVC would also be fine.

Replies

The VTIsHardwareDecodeSupported also seems very interesting. Is there some way to access this feature through Safari on Mac OS?


https://developer.apple.com/documentation/************/2887343-vtishardwaredecodesupported

I knew one way for play video tag.

The tag name is video tag.

|>>

0.00


If you must use the mission in HTTP LIVE STREMING, You take the file style on m3u files.

That is like this

#EXT-X-VERSION:3

#EXTM3U

#EXT-X-TARGETDURATION:142

#EXT-X-MEDIA-SEQUENCE:1

#EXT-X-PLAYLIST-TYPE:LIVE

#EXTINF:142, title - artist

url.mp4

#EXT-X-ENDLIST

I think this is what I need:

var config = {
  type: 'media-source',
  video: {
       contentType: 'video/mp4; codecs="hvc1.2.4.L153.90"',
       width: 1920,
       height: 1080,
       bitrate: 2646242, // number of bits used to encode a second of video
       framerate: '50' // number of frames used in one second
  }
};

navigator.mediaCapabilities.decodingInfo(config).then(result => {
  console.log({result});
});