الرجوع إلى فاصل إعلاني تم تخطّيه
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
وبصفتك ناشر فيديو، قد تحتاج إلى منع المشاهدين من
تخطّي الإعلانات أثناء التشغيل عندما يتخطّى المستخدم الفاصل الإعلاني
يمكنك إعادتها إلى بداية الفاصل الإعلاني، ثم
إلى موقع البحث بعد اكتمال ذلك الفاصل الإعلاني. هذا النمط
تسمى "Snapback".
كمثال، انظر الرسم التخطيطي أدناه. إذا كان المستخدم يشاهد فيديو
ويقرر الانتقال من علامة 5 دقائق إلى 15 دقيقة.
ومع ذلك، هناك فاصل إعلاني عند الوصول إلى علامة الـ 10 دقائق التي تريد
ليتمكّنوا من مشاهدة المحتوى بعد انتهائه:

لعرض هذا الفاصل الإعلاني، اتّبِع الخطوات التالية:
- تحقّق مما إذا كان المستخدم قد أجرى عملية بحث تجاوزت فاصل إعلاني لم تتم مشاهدته.
وفي هذه الحالة، ارجع إلى الفاصل الإعلاني.
- بعد اكتمال الفاصل الإعلاني، يمكنك إعادته إلى موضعه الأصلي.
وفي شكل الرسم التخطيطي، يبدو ذلك كما يلي:

في ما يلي طريقة تنفيذ Snapack باستخدام حزمة تطوير البرامج لإدراج إعلان ديناميكي لإعلانات الوسائط التفاعلية، كما هو موضّح في
مثال متقدم.
منع التمرير حتى لا تتم مشاهدة فاصل إعلاني
تحقّق مما إذا كان المستخدم قد أجرى عملية بحث تجاوزت فاصل إعلاني لم تتم مشاهدته.
وفي هذه الحالة، ارجع إلى الفاصل الإعلاني.
يعتمد نموذج Roku المتقدّم على الضغط على أزرار جهاز التحكّم عن بُعد
المستخدم لتقديمه - في كل مرة يضغط فيها المستخدم على زر التقديم،
الانتقال للأمام في البث المباشر لعدد محدد من الثواني. تتحقّق الطريقة نفسها التي تعالج هذه القفزة أيضًا ممّا إذا كانت القفزة تنقل المستخدم إلى فاصل إعلاني أو تتجاوزه، وإذا كان الأمر كذلك، يتم توجيه المستخدم إلى بداية هذا الفاصل الإعلاني بدلاً من ذلك:
Function handleFastForward(player as Object, streamManager as Object, updatedTime As Integer)
previousAd = streamManager.getPreviousCuePoint(updatedTime)
If previousAd = Invalid or previousAd.hasPlayed
player.seek(updatedTime * 1000)
Else If previousAd.start > player.currentTime
player.isSnapback = True
player.timeAfterSnapback = updatedTime
player.seek(previousAd.start * 1000 + 1000)
End If
End Function
إعادة المستخدم إلى هدفه الأصلي
في معالج "adBreakEnded
"، تحقَّق ممّا إذا كان الإعلان السابق
تم تشغيل استراحة نتيجة استعادة الاتصال. إذا كان الأمر كذلك، فارجع
مستخدم إلى المكان الذي كانوا يحاولون الوصول إليه في البداية (طالما
إذ لم تكن في منتصف الفاصل الإعلاني الذي تم تشغيله للتو):
player.adBreakEnded = Function(adBreakInfo as Object)
If m.isSnapback
m.seek(m.timeAfterSnapback * 1000)
m.isSnapback = False
End If
End Function
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-21 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-21 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eSnapback prevents viewers from skipping mid-roll ads by returning them to the start of the ad break if they attempt to seek past it.\u003c/p\u003e\n"],["\u003cp\u003eWhen snapback is triggered, viewers are taken back to the ad and then returned to their original seek location after the ad completes.\u003c/p\u003e\n"],["\u003cp\u003eImplementing snapback involves checking for seeks past unwatched ad breaks and redirecting the viewer, then returning them to their desired location afterwards.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code snippets demonstrate how to implement snapback using the IMA DAI SDK, handling seek events and ad break endings.\u003c/p\u003e\n"]]],[],null,["# Return to a skipped ad break\n\nAs a video publisher, you may want to prevent your viewers from\nseeking past your mid-roll ads. When a user seeks past an ad break,\nyou can take them back to the start of that ad break, and then return\nthem to their seek location after that ad break has completed. This\nfeature is called \"snapback.\"\n\nAs an example, see the diagram below. Your viewer is watching a video,\nand decides to seek from the 5-minute mark to the 15-minute mark.\nThere is, however, an ad break at the 10-minute mark that you want\nthem to watch before they can watch the content after it:\n\nIn order to show this ad break, take the following steps:\n\n1. Check if the user ran a seek that jumped past an unwatched ad break, and if so, take them back to the ad break.\n2. After the ad break completes, return them to their original seek.\n\nIn diagram form, that looks like this:\n\nHere's how to implement snapack using the IMA DAI SDK, as demonstrated in our\n[Advanced Example](//github.com/googleads/googleads-ima-roku-dai).\n\nPrevent a seek from leaving an ad break unwatched\n-------------------------------------------------\n\nCheck if the user has run a seek that went past an unwatched ad break,\nand if so, take them back to the ad break.\nThe Roku advanced sample relies on remote button presses for the\nuser to seek - each time the user presses the forward button, they\njump forward in the stream by a set number of seconds. The same\nmethod that handles this jump also checks to see if the jump\ntakes/ them past or into an ad break, and if it does, sends the user\nto the start of that ad break instead: \n\n Function handleFastForward(player as Object, streamManager as Object, updatedTime As Integer)\n previousAd = streamManager.getPreviousCuePoint(updatedTime)\n If previousAd = Invalid or previousAd.hasPlayed\n player.seek(updatedTime * 1000)\n Else If previousAd.start \u003e player.currentTime\n player.isSnapback = True\n player.timeAfterSnapback = updatedTime\n player.seek(previousAd.start * 1000 + 1000)\n End If\n End Function\n\nPut the user back to their original seek\n----------------------------------------\n\nIn your `adBreakEnded` handler, check to see if the previous ad\nbreak was played as the result of snapback. If so, return the\nuser to the place they were trying to seek to initially (as long\nas it wasn't the middle of the ad break that just played): \n\n player.adBreakEnded = Function(adBreakInfo as Object)\n If m.isSnapback\n m.seek(m.timeAfterSnapback * 1000)\n m.isSnapback = False\n End If\n End Function"]]