UNPKG

rx-player

Version:
24 lines (23 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = shouldPerformInitialSeekToZero; var config_1 = require("../config"); var env_detector_1 = require("./env_detector"); /** * Determines whether the player should perform an explicit initial seek to 0. * * In most cases, a media element starts at position 0 and no initial seek is * needed. The exception is Safari when playing HLS streams: the native player * may start at the live position instead of 0, so performing an explicit seek * ensures the player starts from the intended initial position. * * @returns {boolean} `true` if an explicit initial seek to 0 should be performed. */ function shouldPerformInitialSeekToZero() { var FORCE_INITIAL_SEEK_TO_ZERO = config_1.default.getCurrent().FORCE_INITIAL_SEEK_TO_ZERO; if (FORCE_INITIAL_SEEK_TO_ZERO) { return FORCE_INITIAL_SEEK_TO_ZERO; } return (env_detector_1.default.browser === env_detector_1.default.BROWSERS.SafariDesktop || env_detector_1.default.browser === env_detector_1.default.BROWSERS.SafariMobile); }