Skip to content

Commit 8b66e91

Browse files
committed
use http: protocol for http: location otherwise https:
1 parent de6a8d0 commit 8b66e91

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/loadImaSdk.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ interface ImaWindow {
77
};
88
}
99

10-
const imaSdkSrc = "//imasdk.googleapis.com/js/sdkloader/ima3.js";
10+
const imaSdkProtocol = location.protocol === "http:" ? "http:" : "https:";
11+
const imaSdkSrc = imaSdkProtocol + "//imasdk.googleapis.com/js/sdkloader/ima3.js";
1112
let pendingPromise: Promise<typeof google.ima> | null = null;
1213

1314
const promiseFinished = () => {

0 commit comments

Comments
 (0)