Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.3 kB
1
Indexable
Never
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://sdk.teester.com/loader.js";
document.getElementsByTagName("head")[0].appendChild(script);

window.onTeesterReady = window.onTeesterReady || [];
window.onTeesterReady.push(function (SDK) {
    var playerKey = "97ef9a9b-26de-4752-9c1d-b9a9a52044e8"
    var trackingKey = "80c3be5a-d834-4d0e-8356-4c83595b80c8"
    // PRODUCT ID
    var dataLayer = window.dataLayer || [];
    var productId = dataLayer[1].postID;
    //checkVideoAvailability
    SDK.checkVideoAvailability(playerKey, productId, function (value) {
        var divPlayer = document.createElement("div");
        divPlayer.setAttribute("id", "playerTeester");
        
        var player = SDK.init({
            type: 'player',
            args: {
                key: playerKey,
                product: productId,
                width: '100%',
                height: 'inherit'
            }
        }, divPlayer);
        document.querySelector('#tab-description').append(divPlayer);
    });
    var trackProduct = SDK.init({
        type: 'tracking',
        args: {
            key: trackingKey,
            product: productId,
            event: 'PRODUCT_PAGE_VIEW'
        }
    });
});