video.js icon indicating copy to clipboard operation
video.js copied to clipboard

canPlayType return '' for 'video/rtmp

Open steplerbox opened this issue 10 years ago • 3 comments

Chrome, Firefox. Flash enabled. Method player.canPlayType('video/rtmp') returns ''. Why?

And one question. Just interested, why this method returns empty string? Maybe should be false?

steplerbox avatar Nov 02 '16 12:11 steplerbox

The types supported by the Flash tech are rtmp/mp4 and rtmp/flv.

video.js's canPlayType() returns the same values are the HTML5 video element - 'probably', 'maybe' or ''. I'd agree '' is unintuitive, but it's the standard. https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType

mister-ben avatar Nov 02 '16 13:11 mister-ben

https://github.com/videojs/video.js/blob/master/src/js/tech/flash.js#L446 - here list of formats

Flash.formats = { 'video/flv': 'FLV', 'video/x-flv': 'FLV', 'video/mp4': 'MP4', 'video/m4v': 'MP4' };

I think here should be 'video/rtmp'.

steplerbox avatar Nov 02 '16 13:11 steplerbox

This is where to look for RTMP:

https://github.com/videojs/video.js/blob/3a859f97d0647fc3d1ef6b2f4b755c71da8bef63/src/js/tech/flash-rtmp.js#L5-L8

mister-ben avatar Nov 02 '16 14:11 mister-ben