publicVideoPlayerController(Contextcontext,VideoPlayerWithAdPlaybackvideoPlayerWithAdPlayback,ViewplayButton,ViewplayPauseToggle,Stringlanguage,ViewGroupcompanionViewGroup,Loggerlog){...sdkFactory=ImaSdkFactory.getInstance();ImaSdkSettingsimaSdkSettings=sdkFactory.createImaSdkSettings();imaSdkSettings.setLanguage(language);// Tell the SDK you want to control ad break playback.imaSdkSettings.setAutoPlayAdBreaks(false);...}...@OverridepublicvoidonAdEvent(AdEventadEvent){...switch(adEvent.getType()){// Listen for the AD_BREAK_READY event.caseAD_BREAK_READY:// Tell the SDK to play ads when you're ready. To skip this ad break,// simply return from this handler without calling adsManager.start().adsManager.start();break;...}
คำถามที่พบบ่อย
จำเป็นต้องเล่นโฆษณาด้วยตนเองเพื่อติดตั้งใช้งาน IMA SDK หรือไม่
ไม่ การเล่นโฆษณาด้วยตนเองเป็นฟีเจอร์ที่ไม่บังคับสำหรับผู้เผยแพร่โฆษณาที่ไม่ต้องการให้ IMA SDK เล่นช่วงพักโฆษณาโดยอัตโนมัติตามกำหนดการของกฎโฆษณาหรือการตอบกลับ VMAP
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2024-12-22 UTC"],[[["This guide explains how to manually control ad break playback timing in your Android app using the IMA SDK."],["By disabling autoplay and listening for the `AD_BREAK_READY` event, you can trigger ad breaks at your desired moments."],["This feature is optional and provides flexibility for publishers who need custom ad playback control beyond the default ad schedule."],["The Advanced Example showcases the implementation, but the Basic Example with the Exoplayer-IMA extension cannot be used as a basis for this guide."]]],[]]