videojs / videojs-youtube

YouTube playback technology for Video.js
1.12k stars 548 forks source link

fix: Prevent Deprecation Warning on Video.js 8 #623

Open funkymonk91 opened 3 months ago

funkymonk91 commented 3 months ago

Resolves: VIDEOJS: WARN: videojs.createTimeRange is deprecated and will be removed in 9.0; please use videojs.time.createTimeRanges instead.

mister-ben commented 3 months ago

Thanks. The tech still works with v7 of video.js, so to avoid making this a breaking change, this should fallback to videojs.createTimeRange when videojs.time.createTimeRanges is not available.

gkatsev commented 3 months ago

v7 should have both: https://github.com/videojs/video.js/blob/3a128d1d238a3110f1d90c59eb81996e991ba446/src/js/video.js#L435

gkatsev commented 3 months ago

Ignore me, @mister-ben is correct. Needs a fallback for v7 as it doesn't have .time.