Mobile InStream

出自TAMedia
於 2018年10月29日 (一) 10:05 由 imported>Wikiuser 所做的修訂 →‎使用說明
跳至導覽 跳至搜尋

使用說明

1. 於<head></head>之間插入以下程式碼

  <script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/tam-vast.js"></script>

2. 於 Google IMA SDK 內 Request adTagUrl 的地方呼叫 createTAMVastUrl Function 並帶入由 TAMedia 提供之 vast URL 及測試標記,即可使用,Function 將會 Return URL 給您

   var adsRequest = new google.ima.AdsRequest();
   adsRequest.adTagUrl = createTAMVastUrl('https://adc.tamedia.com.tw/rmadp/g/c1234567890111ABC/iadr', 0);
   參數定義與說明:
第一個參數:由TAMedia拿到的vast URL(於TAMedia後台廣告版位列表的下載嵌入程式碼自動取得)
第二個參數:測試標記(0:正式模式;1:測試模式)

3. 若須修改SKIP語言,請在IMA SDK 初始化階段(請求廣告前)加上以下設定即可

  google.ima.settings.setLocale('zh_tw'); //預設為英文,此設定為調整成中文

4. 若須修改設定以取得較高 bitrate 的影片,請在IMA SDK AdsManagerLoaded 加上以下設定即可

  adsRenderingSettings.bitrate = 2000; //set maximun bitrate