@faintlines/video-player
Advanced tools
Comparing version 1.1.15 to 1.2.0
@@ -116,3 +116,6 @@ import React, { forwardRef, useState, useRef, useEffect, useContext } from 'react'; | ||
function supportsHLS() { | ||
var mediaSource = window.MediaSource || window.WebKitMediaSource; | ||
var sourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer; | ||
function hasNativeHlsSupport() { | ||
var video = document.createElement("video"); | ||
@@ -122,6 +125,19 @@ return Boolean(video.canPlayType("application/vnd.apple.mpegURL") || video.canPlayType("audio/mpegurl")); | ||
var SUPPORTS_HLS = supportsHLS(); // https://github.com/Dash-Industry-Forum/dash.js/issues/2055#issuecomment-313187528 | ||
function hasHlsJsSupport() { | ||
// based on https://github.com/video-dev/hls.js/blob/c35441b94f7ffef94e12ecf99aa7a5c61d5759a0/src/is-supported.ts#L8 | ||
if (!mediaSource) { | ||
return false; | ||
} | ||
var SUPPORTS_DASH = typeof (window.MediaSource || window.WebKitMediaSource) === "function"; | ||
var isTypeSupported = mediaSource && typeof mediaSource.isTypeSupported === "function" && mediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'); // if SourceBuffer is exposed ensure its API is valid | ||
// safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible | ||
var sourceBufferValidAPI = !sourceBuffer || sourceBuffer.prototype && typeof sourceBuffer.prototype.appendBuffer === "function" && typeof sourceBuffer.prototype.remove === "function"; | ||
return !!isTypeSupported && !!sourceBufferValidAPI; | ||
} | ||
var SUPPORTS_HLS = hasNativeHlsSupport() || hasHlsJsSupport(); // https://github.com/Dash-Industry-Forum/dash.js/issues/2055#issuecomment-313187528 | ||
var SUPPORTS_DASH = mediaSource && typeof mediaSource.isTypeSupported === "function"; | ||
var ReactPlayer = require("react-player/file"); | ||
@@ -244,3 +260,3 @@ | ||
file: { | ||
hlsVersion: "1.0.7", | ||
hlsVersion: "1.0.10", | ||
dashVersion: "4.0.0-npm", | ||
@@ -247,0 +263,0 @@ attributes: { |
{ | ||
"name": "@faintlines/video-player", | ||
"version": "1.1.15", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -36,3 +36,3 @@ "license": "UNLICENSED", | ||
}, | ||
"gitHead": "02661259b0aaeb0368b11d22d8166f96b28382b7" | ||
"gitHead": "79445df30af239590c5517f14968f6b59ea31a13" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22773
252