विज्ञापन के लिए ब्रेक के दौरान वीडियो चलाने की सुविधा कॉन्फ़िगर करना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
प्लैटफ़ॉर्म चुनें:
Android
iOS
यह गाइड उन उपयोगकर्ताओं के लिए है जो विज्ञापन ब्रेक के चलने के समय को मैन्युअल तरीके से कंट्रोल करना चाहते हैं. डिफ़ॉल्ट रूप से लागू करने पर, एसडीके वीडियो के बीच में विज्ञापन दिखाने की सुविधा को शेड्यूल किए गए समय पर अपने-आप चालू कर देता है. कुछ डेवलपर, एसडीके टूल को इन विज्ञापन ब्रेक को अपने-आप चलाने से रोकना चाहते हैं. विज्ञापन ब्रेक को मैन्युअल तरीके से चलाने की सुविधा लागू करने पर, एसडीके AD_BREAK_READY
इवेंट को तब ट्रिगर करता है, जब मिड-रोल विज्ञापन लोड हो जाता है. इसके बाद, वह विज्ञापन ब्रेक को चलाने के लिए आपके निर्देश का इंतज़ार करता है.
ज़रूरी शर्तें
- IMA SDK टूल लागू किया गया हो.
काम की शुरुआती जानकारी
अगर आपको अब भी अपने ऐप्लिकेशन में IMA SDK लागू करना है, तो हमारी शुरू करने से जुड़ी गाइड देखें.
मैन्युअल तरीके से विज्ञापन के लिए ब्रेक चलाने की सुविधा को कॉन्फ़िगर करने के लिए, यह तरीका अपनाएं:
- एसडीके को बताएं कि आपको विज्ञापन ब्रेक के दौरान वीडियो चलाने की सुविधा को कंट्रोल करना है.
- AD_BREAK_READY इवेंट को सुनें.
- जब आप विज्ञापन दिखाने के लिए तैयार हों, तब SDK को विज्ञापन दिखाने के लिए कहें.
नीचे दिए गए स्निपेट में, मैन्युअल तरीके से विज्ञापन ब्रेक चलाने की सुविधा लागू करने के लिए,
ऐडवांस उदाहरण में किए जाने वाले ज़रूरी बदलावों के बारे में बताया गया है:
- (void)setUpAdsLoader {
...
IMASettings settings = [[IMASettings alloc] init];
// Tell the SDK that you want to control ad break playback.
settings.autoPlayAdBreaks = NO;
self.adsLoader = [[IMAAdsLoader alloc] initWithSettings:settings];
...
}
- (void)adsManager:(IMAAdsManager *)adsManager didReceiveAdEvent:(IMAAdEvent *)event {
...
switch (event.type) {
// Listen for the AD_BREAK_READY event
case kIMAAdEvent_AD_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 लागू करने के लिए इसकी ज़रूरत होती है?
- बिलकुल नहीं! यह सुविधा सिर्फ़ उन पब्लिशर के लिए उपलब्ध है जो नहीं चाहते कि विज्ञापन नियमों या VMAP रिस्पॉन्स के ज़रिए शेड्यूल किए गए वीडियो के बीच में दिखने वाले विज्ञापन, IMA SDK टूल अपने-आप चलाए.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-31 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-31 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThis guide explains how to manually control ad break playback timing within the IMA SDK for iOS apps, preventing automatic mid-roll playback.\u003c/p\u003e\n"],["\u003cp\u003eBy implementing manual ad break playback, developers can trigger mid-roll ads using the \u003ccode\u003eAD_BREAK_READY\u003c/code\u003e event and the \u003ccode\u003estart\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThis feature is optional and intended for publishers seeking greater control over ad playback timing, requiring code modifications to the IMA SDK setup and event handling.\u003c/p\u003e\n"],["\u003cp\u003eManual ad break playback involves three steps: disabling automatic ad breaks, listening for the \u003ccode\u003eAD_BREAK_READY\u003c/code\u003e event, and initiating ad playback when desired.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/interactive-media-ads/docs/sdks/android/client-side/manual_ad_playback \"View this page for the Android platform docs.\") [iOS](/interactive-media-ads/docs/sdks/ios/client-side/manual_ad_playback \"View this page for the iOS platform docs.\")\n\nThis guide is intended for users who want manual control over ad break playback timing. In a default implementation, the SDK automatically plays mid-rolls at their scheduled time. Some developers may want to prevent the SDK from playing these ad breaks automatically. By implementing manual ad break playback, the SDK fires an `AD_BREAK_READY` event when a mid-roll has been loaded, and wait on you to start the break's playback.\n\nPrerequisites\n\n\u003cbr /\u003e\n\n- iOS application with the IMA SDK implemented.\n\n\u003cbr /\u003e\n\nHelpful primers\n\nIf you still need to implement the IMA SDK in your app, check out our [Get Started guide](/interactive-media-ads/docs/sdks/ios/client-side).\n\nConfiguring Manual Ad Break Playback Configuring manual ad break playback takes three steps: \n\n1. Tell the SDK you want to control ad break playback.\n2. Listen for the AD_BREAK_READY event.\n3. Tell the SDK to play ads when you're ready.\n\nThe snippet below shows the modifications required on the [Advanced Example](//github.com/googleads/googleads-ima-ios/tree/master/Objective-C/AdvancedExample) to implement manual ad break playback: \n\n```objective-c\n- (void)setUpAdsLoader {\n ...\n IMASettings settings = [[IMASettings alloc] init];\n // Tell the SDK that you want to control ad break playback.\n settings.autoPlayAdBreaks = NO;\n self.adsLoader = [[IMAAdsLoader alloc] initWithSettings:settings];\n ...\n}\n\n- (void)adsManager:(IMAAdsManager *)adsManager didReceiveAdEvent:(IMAAdEvent *)event {\n ...\n switch (event.type) {\n // Listen for the AD_BREAK_READY event\n case kIMAAdEvent_AD_BREAK_READY:\n // Tell the SDK to play ads when you're ready. To skip this ad break,\n // simply return from this handler without calling [adsManager start].\n [adsManager start];\n break;\n ...\n }\n}\n```\n\nFAQ\n\nIs this required for an IMA SDK implementation?\n: Absolutely not! This is only offered for publishers who do not want the IMA SDK to automatically play mid-roll ads when they are scheduled by your ad rules or VMAP response."]]