-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Hi supporters,
I installed this newest library on my React Js project, but got a the error message:
Attempted import error: 'google' is not exported from '@alugha/ima'.
Here is my code:
`
import React, {Component} from "react";
import { loadImaSdk, google } from "@alugha/ima";
class AdsVideo extends Component<any, any> {
public readonly width = 320;
public readonly height = 180;
private adsManager: google.ima.AdsManager | undefined;
private adsLoader: google.ima.AdsLoader | undefined;
private adDisplayContainer: google.ima.AdDisplayContainer | undefined;
private videoContent: HTMLVideoElement | undefined;
private ima: any;
async componentDidMount() {
try{
this.ima = await loadImaSdk()
this.initData(this.ima)
} catch (e) {
console.log("SDK could not be loaded. Check your ad blocker!")
}
}
initData(ima: any) {
this.videoContent = document.getElementById("ads-video--content-element") as HTMLVideoElement
this.requestAds(ima)
}
}`
Dependencies:
"@alugha/ima": "^2.0.3",
"react": "^16.12.0",
"typescript": "^3.7.5",
...
Please check this issue. Thanks
Metadata
Metadata
Assignees
Labels
No labels