Skip to content

Instantly share code, notes, and snippets.

@astein
astein / html5_ima_sdk_example.js
Last active August 18, 2022 16:02
Example of using Google IMA SDK for HTML5
// video DOM inside creative
//<div id="videoContainer">
// <video id="videoContainer"></video>
//</div>
// load IMA SDK at init load time
$.getScript('//imasdk.googleapis.com/js/sdkloader/ima3.js');
// usage: startVideo( /* vast tag url */ );
package com.truex.placements.extensions
{
import flash.display.Sprite;
import flash.external.ExternalInterface;
import flash.system.Security;
import flash.utils.setTimeout;
import tv.freewheel.ad.behavior.IAdManager;
import tv.freewheel.ad.behavior.IConstants;
import tv.freewheel.ad.behavior.IEvent;
package com.truex.placements.extensions
{
import com.adobe.serialization.json.JSONEncoder;
import com.truex.placements.vpaid.VPAIDLoader;
import flash.display.Sprite;
import flash.events.Event;
import flash.external.ExternalInterface;
import flash.system.Security;
import flash.utils.setTimeout;
@astein
astein / VASTVideoExample.as
Last active June 20, 2016 22:55
IMA SDK Example
package
{
import com.google.ads.ima.api.AdErrorEvent;
import com.google.ads.ima.api.AdEvent;
import com.google.ads.ima.api.AdsLoader;
import com.google.ads.ima.api.AdsManager;
import com.google.ads.ima.api.AdsManagerLoadedEvent;
import com.google.ads.ima.api.AdsRenderingSettings;
import com.google.ads.ima.api.AdsRequest;
import com.google.ads.ima.api.ViewModes;
@astein
astein / mobile_example.js
Created July 15, 2015 17:41
Mobile engagement example
TXM.creative = {
_engagement: null,
_images: {},
_loadedAssets: 0,
_totalAssets: 0,
init: function() {
TXM.dispatcher.dispatchEvent('INTERACTIVE_ASSET_LOADED');
TXM.studio.ElementFactory = {
createElement: function(config) {
var element = null;
switch (config.type) {
case 'Image':
element = $('<img>');
element.attr('src', config.image_url);
break;
case 'Button':
@astein
astein / id_img_share_logic.as
Last active September 2, 2016 20:11
Whitewave - ID Ready to Drink, Q2/Q3, '15
package com.socialvibe.modules.logic
{
import com.adobe.serialization.json.JSONDecoder;
import com.greensock.TweenLite;
import com.greensock.easing.Elastic;
import com.greensock.easing.Expo;
import com.greensock.easing.Linear;
import com.greensock.easing.Quad;
import com.greensock.easing.Strong;
import com.socialvibe.core.ui.controls.SVButton;
package com.truex.placements.extensions
{
import com.truex.placements.vpaid.VPAIDLoader;
import flash.display.Sprite;
import flash.events.Event;
import flash.system.Security;
import tv.freewheel.ad.behavior.IConstants;
import tv.freewheel.ad.behavior.IRenderer;
package com.socialvibe.modules.logic
{
import com.adobe.serialization.json.JSONDecoder;
import com.greensock.TweenLite;
import com.greensock.easing.Elastic;
import com.greensock.easing.Expo;
import com.greensock.easing.Quad;
import com.socialvibe.core.ui.controls.SVButton;
import com.socialvibe.core.ui.controls.SVImage;
import com.socialvibe.core.ui.controls.SVImageButton;
@astein
astein / celtra_wrapper.js
Created August 22, 2014 18:56
Celtra js wrapper example. For 2.0 container.
TXM.dispatcher.addEventListener('START_ENGAGEMENT', function() {
TXM.params.celtraCorrectionId = setInterval(correctZIndex, 200);
var celtraDiv = document.createElement('div');
document.body.appendChild(celtraDiv);
celtraDiv.className = 'celtra-ad-v3';
var celtraImg = document.createElement('img');