Chromecast on Lives
+ remove some dev code that's no longer needed...
This commit is contained in:
parent
4cec3ee9b3
commit
7477208c4e
2 changed files with 2 additions and 25 deletions
|
@ -21,7 +21,6 @@ import React, { useEffect, useRef, useState } from 'react';
|
||||||
import recsys from './plugins/videojs-recsys/plugin';
|
import recsys from './plugins/videojs-recsys/plugin';
|
||||||
// import runAds from './ads';
|
// import runAds from './ads';
|
||||||
import videojs from 'video.js';
|
import videojs from 'video.js';
|
||||||
import { LIVESTREAM_STREAM_X_PULL, LIVESTREAM_CDN_DOMAIN, LIVESTREAM_STREAM_DOMAIN } from 'constants/livestream';
|
|
||||||
import { useIsMobile } from 'effects/use-screensize';
|
import { useIsMobile } from 'effects/use-screensize';
|
||||||
|
|
||||||
const canAutoplay = require('./plugins/canAutoplay');
|
const canAutoplay = require('./plugins/canAutoplay');
|
||||||
|
@ -237,7 +236,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||||
requestSubtitleFn: (src) => channelName || '',
|
requestSubtitleFn: (src) => channelName || '',
|
||||||
},
|
},
|
||||||
bigPlayButton: embedded, // only show big play button if embedded
|
bigPlayButton: embedded, // only show big play button if embedded
|
||||||
liveui: true,
|
liveui: isLivestreamClaim,
|
||||||
suppressNotSupportedError: true,
|
suppressNotSupportedError: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -359,27 +358,6 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
vjsPlayer.addClass('livestreamPlayer');
|
vjsPlayer.addClass('livestreamPlayer');
|
||||||
|
|
||||||
// @if process.env.NODE_ENV!='production'
|
|
||||||
videojs.Vhs.xhr.beforeRequest = (options) => {
|
|
||||||
if (!options.headers) options.headers = {};
|
|
||||||
options.headers['X-Pull'] = LIVESTREAM_STREAM_X_PULL;
|
|
||||||
options.uri = options.uri.replace(LIVESTREAM_CDN_DOMAIN, LIVESTREAM_STREAM_DOMAIN);
|
|
||||||
return options;
|
|
||||||
};
|
|
||||||
// @endif
|
|
||||||
|
|
||||||
// const newPoster = livestreamData.ThumbnailURL;
|
|
||||||
|
|
||||||
// pretty sure it's not working
|
|
||||||
// vjsPlayer.poster(newPoster);
|
|
||||||
|
|
||||||
// here specifically because we don't allow rewinds at the moment
|
|
||||||
// $FlowFixMe
|
|
||||||
// vjsPlayer.on('play', function () {
|
|
||||||
// // $FlowFixMe
|
|
||||||
// vjsPlayer.liveTracker.seekToLiveEdge();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
vjsPlayer.src({
|
vjsPlayer.src({
|
||||||
type: 'application/x-mpegURL',
|
type: 'application/x-mpegURL',
|
||||||
|
@ -388,7 +366,6 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||||
} else {
|
} else {
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
vjsPlayer.removeClass('livestreamPlayer');
|
vjsPlayer.removeClass('livestreamPlayer');
|
||||||
videojs.Vhs.xhr.beforeRequest = (options) => {};
|
|
||||||
|
|
||||||
// change to m3u8 if applicable
|
// change to m3u8 if applicable
|
||||||
const response = await fetch(source, { method: 'HEAD', cache: 'no-store' });
|
const response = await fetch(source, { method: 'HEAD', cache: 'no-store' });
|
||||||
|
|
|
@ -329,7 +329,7 @@ button.vjs-big-play-button {
|
||||||
.vjs-time-divider,
|
.vjs-time-divider,
|
||||||
.vjs-button--theater-mode,
|
.vjs-button--theater-mode,
|
||||||
//.vjs-quality-selector,
|
//.vjs-quality-selector,
|
||||||
.vjs-chromecast-button, // hopefully we can use chromecast in the future at some point
|
//.vjs-chromecast-button,
|
||||||
.vjs-button--autoplay-next
|
.vjs-button--autoplay-next
|
||||||
//,.vjs-progress-control
|
//,.vjs-progress-control
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue