Skip to content

Commit

Permalink
Fix: config header is null
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Nov 7, 2023
1 parent 9c228aa commit 82e7413
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/components/Player.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ const playFlv = (player: HTMLMediaElement, url: string, art: any) => {
.then((mpegts) => {
if (mpegts.isSupported()) {
const Config: Record<string, Record<string, string>> = {};
for (const key in Props.options.headers) {
Config["headers"][key] = Props.options.headers[key];
}
Config["headers"] = Props.options.headers;
const flv = mpegts.createPlayer({ type: "flv", url, isLive: art.option.isLive }, Config);
Expand All @@ -89,9 +87,7 @@ const playMse = (player: HTMLMediaElement, url: string, art: any) => {
.then((mpegts) => {
if (mpegts.isSupported()) {
const Config: Record<string, Record<string, string>> = {};
for (const key in Props.options.headers) {
Config["headers"][key] = Props.options.headers[key];
}
Config["headers"] = Props.options.headers;
const mse = mpegts.createPlayer({ type: "mse", url, isLive: art.option.isLive }, Config);
Expand All @@ -111,9 +107,7 @@ const playMpegts = (player: HTMLMediaElement, url: string, art: any) => {
.then((mpegts) => {
if (mpegts.isSupported()) {
const Config: Record<string, Record<string, string>> = {};
for (const key in Props.options.headers) {
Config["headers"][key] = Props.options.headers[key];
}
Config["headers"] = Props.options.headers;
const mpegtsPlayer = mpegts.createPlayer(
{ type: "mpegts", url, isLive: art.option.isLive },
Expand All @@ -136,9 +130,7 @@ const playM2ts = (player: HTMLMediaElement, url: string, art: any) => {
.then((mpegts) => {
if (mpegts.isSupported()) {
const Config: Record<string, Record<string, string>> = {};
for (const key in Props.options.headers) {
Config["headers"][key] = Props.options.headers[key];
}
Config["headers"] = Props.options.headers;
const m2ts = mpegts.createPlayer({ type: "m2ts", url, isLive: art.option.isLive }, Config);
Expand Down

0 comments on commit 82e7413

Please sign in to comment.