راهنمای ادغام SDK برای تلویزیون را درگیر کنید

Continue Watching از خوشه Continuation برای نمایش ویدیوهای ناتمام استفاده می‌کند و قسمت‌های بعدی را از همان فصل تلویزیون، از چندین برنامه در یک گروه‌بندی رابط کاربری تماشا می‌کند. می‌توانید موجودیت‌های آن‌ها را در این کلاستر ادامه دهید. این راهنما را دنبال کنید تا یاد بگیرید چگونه تعامل کاربر را از طریق تجربه تماشای ادامه با استفاده از Engage SDK افزایش دهید.

قبل از کار

قبل از شروع، مراحل زیر را کامل کنید:

  1. به Target API 19 یا بالاتر به روز رسانی کنید

  2. کتابخانه com.google.android.engage را به برنامه خود اضافه کنید:

    SDK های جداگانه ای برای استفاده در ادغام وجود دارد: یکی برای برنامه های تلفن همراه و دیگری برای برنامه های تلویزیون.

    موبایل

    
      dependencies {
        implementation 'com.google.android.engage:engage-core:1.5.5
      }
    

    تلویزیون

    
      dependencies {
        implementation 'com.google.android.engage:engage-tv:1.0.2
      }
    
  3. محیط سرویس Engage را در فایل AndroidManifest.xml روی production قرار دهید.

    موبایل

    
    <meta-data
        android:name="com.google.android.engage.service.ENV"
        android:value="PRODUCTION" />
    

    تلویزیون

    
    <meta-data
        android:name="com.google.android.engage.service.ENV"
        android:value="PRODUCTION" />
    
  4. اضافه کردن مجوز برای WRITE_EPG_DATA برای tv apk

    <uses-permission android:name="com.android.providers.tv.permission.WRITE_EPG_DATA" />
    
  5. با استفاده از یک سرویس پس‌زمینه، مانند androidx.work ، برای زمان‌بندی، انتشار محتوای قابل اعتماد را تأیید کنید.

  6. برای ارائه یک تجربه تماشای یکپارچه، در صورت وقوع این رویدادها، داده‌های تماشای ادامه را منتشر کنید:

    1. اولین ورود: هنگامی که کاربر برای اولین بار وارد سیستم می شود، داده ها را منتشر کنید تا مطمئن شوید که تاریخچه مشاهده او فوراً در دسترس است.
    2. ایجاد یا تغییر نمایه (برنامه‌های چند نمایه): اگر برنامه شما از چندین نمایه پشتیبانی می‌کند، زمانی که کاربر نمایه‌ها را ایجاد می‌کند یا تغییر می‌دهد، داده‌ها را منتشر کنید.
    3. وقفه در پخش ویدیو: برای کمک به کاربران از جایی که کار را متوقف کرده‌اند، داده‌ها را هنگام توقف یا توقف ویدیو، یا زمانی که برنامه در حین پخش خارج می‌شود، منتشر کنید.
    4. ادامه به‌روزرسانی‌های سینی تماشا (در صورت پشتیبانی): وقتی کاربر موردی را از سینی تماشای ادامه خود حذف می‌کند، آن تغییر را با انتشار داده‌های به‌روز منعکس کنید.
    5. تکمیل ویدئو:
      1. برای فیلم‌ها، فیلم تکمیل‌شده را از سینی تماشای ادامه دهید. اگر فیلم بخشی از یک سریال است، فیلم بعدی را اضافه کنید تا کاربر را درگیر خود نگه دارید.
      2. برای قسمت‌ها، قسمت تکمیل‌شده را حذف کنید و قسمت بعدی مجموعه را در صورت موجود بودن اضافه کنید تا تماشای ادامه پیدا کند.

کد نمونه

این نمونه برنامه نشان می‌دهد که چگونه توسعه‌دهندگان می‌توانند با APIهای کشف ویدیو یکپارچه شوند تا داده‌های کاربر شخصی‌شده را به Google ارسال کنند. برنامه نمونه همچنین نحوه ساخت یک ماژول مشترک را نشان می دهد که می تواند هم در برنامه های تلفن همراه و هم در برنامه های تلویزیونی وارد شود، چه زمانی باید انتشار و حذف API ها را فراخوانی کرد و چگونه از Workers برای فراخوانی انتشار و حذف API ها استفاده کرد.

یکپارچه سازی

نمایه حساب

برای اجازه دادن به تجربه شخصی «ادامه تماشا» در Google TV، اطلاعات حساب و نمایه را ارائه دهید. از نمایه حساب برای ارائه موارد زیر استفاده کنید:

  1. شناسه حساب: یک شناسه منحصر به فرد که نشان دهنده حساب کاربر در برنامه شما است. این می تواند شناسه واقعی حساب یا یک نسخه مبهم مناسب باشد.

  2. شناسه نمایه (اختیاری): اگر برنامه شما از چندین نمایه در یک حساب پشتیبانی می‌کند، یک شناسه منحصر به فرد برای نمایه کاربر خاص (دوباره واقعی یا مبهم) ارائه دهید.

// If your app only supports account
val accountProfile = AccountProfile.Builder()
    .setAccountId("your_users_account_id")
    .build()

// If your app supports both account and profile
val accountProfile = AccountProfile.Builder()
    .setAccountId("your_users_account_id")
    .setProfileId("your_users_profile_id")
    .build()

موجودیت ها را ایجاد کنید

SDK موجودیت های مختلفی را برای نشان دادن هر نوع مورد تعریف کرده است. Cluster Continuation از موجودیت های زیر پشتیبانی می کند:

  1. MovieEntity
  2. TvEpisodeEntity
  3. LiveStreamingVideoEntity
  4. VideoClipEntity

URI های مخصوص پلتفرم و تصاویر پوستر را برای این موجودیت ها مشخص کنید.

همچنین، اگر قبلاً این کار را نکرده‌اید، URI‌های پخش برای هر پلتفرم مانند Android TV، Android یا iOS ایجاد کنید. بنابراین وقتی کاربر به تماشای هر پلتفرم ادامه می‌دهد، برنامه از یک URI پخش هدفمند برای پخش محتوای ویدیویی استفاده می‌کند.

// Required. Set this when you want continue watching entities to show up on
// Google TV
val playbackUriTv = PlatformSpecificUri.Builder()
    .setPlatformType(PlatformType.TYPE_ANDROID_TV)
    .setActionUri(Uri.parse("https://www.example.com/entity_uri_for_tv"))
    .build()

// Required. Set this when you want continue watching entities to show up on
// Google TV Android app, Entertainment Space, Playstore Widget
val playbackUriAndroid = PlatformSpecificUri.Builder()
    .setPlatformType(PlatformType.TYPE_ANDROID_MOBILE)
    .setActionUri(Uri.parse("https://www.example.com/entity_uri_for_android"))
    .build()

// Optional. Set this when you want continue watching entities to show up on
// Google TV iOS app
val playbackUriIos = PlatformSpecificUri.Builder()
    .setPlatformType(PlatformType.TYPE_IOS)
    .setActionUri(Uri.parse("https://www.example.com/entity_uri_for_ios"))
    .build()

val platformSpecificPlaybackUris =
    Arrays.asList(playbackUriTv, playbackUriAndroid, playbackUriIos)

تصاویر پوستر به URI و ابعاد پیکسل (ارتفاع و عرض) نیاز دارند. با ارائه چندین تصویر پوستر، فاکتورهای فرم مختلف را هدف قرار دهید، اما بررسی کنید که همه تصاویر دارای نسبت تصویر 16:9 و حداقل ارتفاع 200 پیکسل برای نمایش صحیح موجودیت "Continue Watching" باشند، به خصوص در فضای سرگرمی Google. تصاویر با ارتفاع کمتر از 200 پیکسل ممکن است نشان داده نشوند.

val images = Arrays.asList(
    Image.Builder()
        .setImageUri(Uri.parse("http://www.example.com/entity_image1.png"))
        .setImageHeightInPixel(300)
        .setImageWidthInPixel(169)
        .build(),
    Image.Builder()
        .setImageUri(Uri.parse("http://www.example.com/entity_image2.png"))
        .setImageHeightInPixel(640)
        .setImageWidthInPixel(360)
        .build()
    // Consider adding other images for different form factors
)
MovieEntity

این مثال نحوه ایجاد یک MovieEntity با تمام فیلدهای مورد نیاز را نشان می دهد:

val movieEntity = MovieEntity.Builder()
   .setWatchNextType(WatchNextType.TYPE_CONTINUE)
   .setName("Movie name")
   .addPlatformSpecificPlaybackUri(platformSpecificPlaybackUris)
   .addPosterImages(images)
   // Timestamp in millis for sample last engagement time 12/1/2023 00:00:00
   .setLastEngagementTimeMillis(1701388800000)
   // Suppose the duration is 2 hours, it is 72000000 in milliseconds
   .setDurationMills(72000000)
   // Suppose last playback offset is 1 hour, 36000000 in milliseconds
   .setLastPlayBackPositionTimeMillis(36000000)
   .build()

ارائه جزئیاتی مانند ژانرها و رتبه‌بندی محتوا به Google TV این قدرت را می‌دهد تا محتوای شما را به روش‌های پویاتر به نمایش بگذارد و آن را با بینندگان مناسب مرتبط کند.

val genres = Arrays.asList("Action", "Science fiction")
val rating1 = RatingSystem.Builder().setAgencyName("MPAA").setRating("PG-13").build()
val contentRatings = Arrays.asList(rating1)
val movieEntity = MovieEntity.Builder()
    ...
    .addGenres(genres)
    .addContentRatings(contentRatings)
    .build()

موجودیت‌ها به‌طور خودکار به مدت 60 روز در دسترس می‌مانند، مگر اینکه زمان انقضای کوتاه‌تری را مشخص کنید. فقط در صورتی یک انقضای سفارشی تنظیم کنید که نیاز به حذف نهاد قبل از این دوره پیش‌فرض دارید.

// Set the expiration time to be now plus 30 days in milliseconds
val expirationTime = DisplayTimeWindow.Builder()
    .setEndTimestampMillis(now().toMillis()+2592000000).build()
val movieEntity = MovieEntity.Builder()
    ...
    .addAvailabilityTimeWindow(expirationTime)
    .build()
TVEpisodeEntity

این مثال نحوه ایجاد یک TvEpisodeEntity با تمام فیلدهای مورد نیاز را نشان می دهد:

val tvEpisodeEntity = TvEpisodeEntity.Builder()
    .setWatchNextType(WatchNextType.TYPE_CONTINUE)
    .setName("Episode name")
    .addPlatformSpecificPlaybackUri(platformSpecificPlaybackUris)
    .addPosterImages(images)
    // Timestamp in millis for sample last engagement time 12/1/2023 00:00:00
    .setLastEngagementTimeMillis(1701388800000)
    .setDurationMills(72000000) // 2 hours in milliseconds
    // 45 minutes and 15 seconds in milliseconds is 2715000
    .setLastPlayBackPositionTimeMillis(2715000)
    .setEpisodeNumber("2")
    .setSeasonNumber("1")
    .setShowTitle("Title of the show")
    .build()

رشته شماره اپیزود (مانند "2" ) و رشته شماره فصل (مانند "1" ) قبل از نمایش در کارت ادامه تماشا به شکل مناسب گسترش می یابد. توجه داشته باشید که آنها باید یک رشته عددی باشند، "e2"، "اپیزود 2"، یا "s1" یا "فصل 1" را قرار ندهید.

اگر یک برنامه تلویزیونی خاص یک فصل دارد، شماره فصل را 1 تنظیم کنید.

برای به حداکثر رساندن شانس بینندگان برای یافتن محتوای شما در Google TV، ارائه داده‌های اضافی مانند ژانرها، رتبه‌بندی محتوا و پنجره‌های زمانی در دسترس را در نظر بگیرید، زیرا این جزئیات می‌توانند نمایشگرها و گزینه‌های فیلتر را افزایش دهند.

val genres = Arrays.asList("Action", "Science fiction")
val rating1 = RatingSystem.Builder().setAgencyName("MPAA").setRating("PG-13").build()
val contentRatings = Arrays.asList(rating1)
val tvEpisodeEntity = TvEpisodeEntity.Builder()
    ...
    .addGenres(genres)
    .addContentRatings(contentRatings)
    .setSeasonTitle("Season Title")
    .setShowTitle("Show Title")
    .build()
VideoClipEntity

در اینجا نمونه ای از ایجاد یک VideoClipEntity با تمام فیلدهای مورد نیاز است.

VideoClipEntity یک کلیپ تولید شده توسط کاربر مانند یک ویدیوی یوتیوب را نشان می دهد.

val videoClipEntity = VideoClipEntity.Builder()
    .setPlaybackUri(Uri.parse("https://www.example.com/uri_for_current_platform")
    .setWatchNextType(WatchNextType.TYPE_CONTINUE)
    .setName("Video clip name")
    .addPlatformSpecificPlaybackUri(platformSpecificPlaybackUris)
    .addPosterImages(images)
    // Timestamp in millis for sample last engagement time 12/1/2023 00:00:00
    .setLastEngagementTimeMillis(1701388800000)
    .setDurationMills(600000) //10 minutes in milliseconds
    .setLastPlayBackPositionTimeMillis(300000) //5 minutes in milliseconds
    .addContentRating(contentRating)
    .build()

می‌توانید به‌صورت اختیاری سازنده، تصویر سازنده، زمان ایجاد بر حسب میلی‌ثانیه یا پنجره زمان در دسترس را تنظیم کنید.

LiveStreamingVideoEntity

در اینجا نمونه ای از ایجاد LiveStreamingVideoEntity با تمام فیلدهای مورد نیاز است.

val liveStreamingVideoEntity = LiveStreamingVideoEntity.Builder()
    .setPlaybackUri(Uri.parse("https://www.example.com/uri_for_current_platform")
    .setWatchNextType(WatchNextType.TYPE_CONTINUE)
    .setName("Live streaming name")
    .addPlatformSpecificPlaybackUri(platformSpecificPlaybackUris)
    .addPosterImages(images)
    // Timestamp in millis for sample last engagement time 12/1/2023 00:00:00
    .setLastEngagementTimeMillis(1701388800000)
    .setDurationMills(72000000) //2 hours in milliseconds
    .setLastPlayBackPositionTimeMillis(36000000) //1 hour in milliseconds
    .addContentRating(contentRating)
    .build()

به صورت اختیاری، می‌توانید زمان شروع، پخش‌کننده، نماد پخش‌کننده یا پنجره زمان در دسترس را برای موجودیت پخش زنده تنظیم کنید.

برای اطلاعات دقیق در مورد ویژگی ها و الزامات، به مرجع API مراجعه کنید.

داده های خوشه Continuation را ارائه دهید

AppEngagePublishClient مسئول انتشار خوشه Continuation است. شما از متد publishContinuationCluster() برای انتشار یک شی ContinuationCluster استفاده می کنید.

ابتدا باید از isServiceAvailable() استفاده کنید تا بررسی کنید که آیا سرویس برای یکپارچه سازی در دسترس است یا خیر.

client.publishContinuationCluster(
    PublishContinuationClusterRequest
        .Builder()
        .setContinuationCluster(
            ContinuationCluster.Builder()
                .setAccountProfile(accountProfile)
                .addEntity(movieEntity1)
                .addEntity(movieEntity2)
                .addEntity(tvEpisodeEntity1)
                .addEntity(tvEpisodeEntity2)
                .setSyncAcrossDevices(true)
                .build()
        )
        .build()
)

هنگامی که سرویس درخواست را دریافت می کند، اقدامات زیر در یک تراکنش انجام می شود:

  • داده های موجود ContinuationCluster از شریک توسعه دهنده حذف شده است.
  • داده های درخواست در ContinuationCluster به روز شده تجزیه و ذخیره می شود.

در صورت بروز خطا، کل درخواست رد می شود و وضعیت موجود حفظ می شود.

APIهای منتشر شده APIهای بالا هستند. جایگزین محتوای موجود می شود. اگر نیاز به به‌روزرسانی یک موجودیت خاص در ContinuationCluster دارید، باید همه موجودیت‌ها را دوباره منتشر کنید.

داده های ContinuationCluster فقط باید برای حساب های بزرگسال ارائه شود. فقط زمانی منتشر شود که نمایه حساب متعلق به یک بزرگسال باشد.

همگام سازی بین دستگاهی

پرچم SyncAcrossDevices کنترل می‌کند که آیا داده‌های ContinuationCluster کاربر بین دستگاه‌هایی مانند تلویزیون، تلفن، تبلت‌ها و غیره همگام‌سازی شوند یا خیر. همگام‌سازی بین دستگاهی به طور پیش‌فرض غیرفعال است.

ارزش ها:

  • true: داده‌های ContinuationCluster در تمام دستگاه‌های کاربر به اشتراک گذاشته می‌شود تا تجربه تماشای یکپارچه داشته باشد. ما قویاً این گزینه را برای بهترین تجربه بین دستگاهی توصیه می کنیم.
  • false: داده های ContinuationCluster به دستگاه فعلی محدود شده است.

برنامه رسانه باید یک تنظیم واضح برای فعال/غیرفعال کردن همگام‌سازی بین دستگاهی ارائه دهد. مزایا را برای کاربر توضیح دهید و ترجیحات کاربر را یک بار ذخیره کنید و بر اساس آن در publicContinuationCluster اعمال کنید.

// Example to allow cross device syncing.
client.publishContinuationCluster(
    PublishContinuationClusterRequest
        .Builder()
        .setContinuationCluster(
            ContinuationCluster.Builder()
                .setAccountProfile(accountProfile)
                .setSyncAcrossDevices(true)
                .build()
        )
        .build()
)

برای استفاده حداکثری از ویژگی بین دستگاهی ما، بررسی کنید که برنامه رضایت کاربر را دریافت کند و SyncAcrossDevices به true فعال کنید. این اجازه می دهد تا محتوا به طور یکپارچه در بین دستگاه ها همگام شود، که منجر به تجربه کاربری بهتر و افزایش تعامل می شود. به عنوان مثال، شریکی که این را اجرا کرد، شاهد افزایش 40 درصدی کلیک‌های «ادامه تماشا» بود زیرا محتوای آن‌ها در چندین دستگاه نمایش داده می‌شد.

داده‌های کشف ویدیو را حذف کنید

برای حذف دستی داده‌های کاربر از سرور Google TV قبل از دوره نگهداری استاندارد 60 روزه، از روش ()client.deleteClusters استفاده کنید. پس از دریافت درخواست، سرویس تمام داده‌های کشف ویدیوی موجود برای نمایه حساب یا کل حساب را حذف می‌کند.

فهرست DeleteReason دلیل حذف داده ها را مشخص می کند. کد زیر ادامه مشاهده داده ها را هنگام خروج حذف می کند.


// If the user logs out from your media app, you must make the following call
// to remove continue watching data from the current google TV device,
// otherwise, the continue watching data will persist on the current
// google TV device until 60 days later.
client.deleteClusters(
    DeleteClustersRequest.Builder()
        .setAccountProfile(AccountProfile())
        .setReason(DeleteReason.DELETE_REASON_USER_LOG_OUT)
        .setSyncAcrossDevices(true)
        .build()
)

تست کردن

از برنامه تأیید استفاده کنید تا تأیید کنید که ادغام SDK Engage به درستی کار می کند. برنامه تأیید ابزارهایی را ارائه می دهد که به شما کمک می کند داده های خود را تأیید کنید و تأیید کنید که اهداف پخش به درستی مدیریت می شوند.

پس از فراخوانی انتشار API، با بررسی برنامه تأیید، تأیید کنید که داده‌های شما به درستی منتشر شده است. خوشه ادامه شما باید به عنوان یک ردیف مجزا در رابط برنامه نمایش داده شود.

  • Engage Service Flag را فقط برای ساخت‌های غیر تولیدی در فایل Manifest Android برنامه خود تنظیم کنید.
  • برنامه Engage Verify را نصب و باز کنید
  • اگر isServiceAvailable false است، روی دکمه "Toggle" کلیک کنید تا فعال شود.
  • نام بسته برنامه خود را وارد کنید تا پس از شروع انتشار، داده های منتشر شده به طور خودکار مشاهده شود.
  • این اقدامات را در برنامه خود آزمایش کنید:
    • وارد شوید.
    • بین پروفایل ها جابجا شوید (در صورت وجود).
    • شروع کنید، سپس یک ویدیو را متوقف کنید یا به صفحه اصلی بازگردید.
    • برنامه را در حین پخش ویدیو ببندید.
    • یک مورد را از ردیف "ادامه تماشا" (در صورت پشتیبانی) حذف کنید.
  • پس از هر اقدام، تأیید کنید که برنامه شما از API publishContinuationClusters استفاده کرده است و داده‌ها به درستی در برنامه تأیید نمایش داده می‌شوند.
  • برنامه راستی‌آزمایی یک چک سبز رنگ «همه خوب» را برای موجودیت‌هایی که به درستی اجرا شده‌اند نشان می‌دهد.

    نماگرفت موفقیت برنامه تأیید
    شکل 1. تأیید موفقیت برنامه
  • برنامه راستی‌آزمایی هر موجودیت مشکل‌ساز را پرچم‌گذاری می‌کند.

    تصویر صفحه خطای تأیید برنامه
    شکل 2. خطای برنامه تأیید
  • برای عیب‌یابی موجودیت‌های دارای خطا، از کنترل از راه دور تلویزیون خود برای انتخاب و کلیک کردن آن موجود در برنامه تأیید استفاده کنید. مشکلات خاص برای بررسی شما نمایش داده شده و با رنگ قرمز برجسته می شوند (نمونه زیر را ببینید).

    جزئیات خطای برنامه تأیید
    شکل 3. جزئیات خطای برنامه تأیید

REST API

Engage SDK یک API REST ارائه می‌کند تا تجربه تماشای مداوم را در پلتفرم‌های غیر اندرویدی مانند iOS، Roku TV ارائه دهد. API به توسعه‌دهندگان اجازه می‌دهد تا وضعیت «ادامه تماشا» را برای کاربرانی که از پلتفرم‌های غیر اندرویدی انتخاب کرده‌اند، به‌روزرسانی کنند.

پیش نیازها

  • ابتدا باید ادغام مبتنی بر Engage SDK روی دستگاه را به پایان برسانید. این مرحله مهم ارتباط لازم را بین شناسه کاربری Google و AccountProfile برنامه شما برقرار می‌کند.
  • API Access and Authentication: برای مشاهده و فعال کردن API در پروژه Google Cloud خود، باید یک فرآیند لیست مجاز را طی کنید. همه درخواست های API نیاز به احراز هویت دارند.

دستیابی به دسترسی

برای دسترسی به مشاهده و فعال کردن API در Google Cloud Console، حساب شما باید ثبت شود.

  1. شناسه مشتری Google Workspace باید در دسترس باشد. اگر در دسترس نیست، ممکن است لازم باشد Google Workspace و همچنین هر حساب Google را که می‌خواهید برای تماس با API استفاده کنید، راه‌اندازی کنید.
  2. با استفاده از ایمیل مرتبط با Google Workspace، یک حساب با Google Cloud Console راه اندازی کنید.
  3. یک پروژه جدید ایجاد کنید
  4. یک حساب کاربری برای API Authentication ایجاد کنید. پس از ایجاد حساب سرویس، دو مورد خواهید داشت:
    • شناسه حساب سرویس
    • یک فایل JSON با کلید حساب سرویس شما. این فایل را ایمن نگه دارید، برای احراز هویت مشتری خود در API بعداً به آن نیاز دارید.
  5. Workspace و حساب‌های Google مرتبط اکنون می‌توانند از REST API استفاده کنند. پس از انتشار تغییر، به شما اطلاع داده می شود که آیا API آماده فراخوانی توسط حساب های سرویس شما است یا خیر.
  6. برای آماده شدن برای برقراری تماس API واگذار شده، این مراحل را دنبال کنید.

انتشار خوشه ادامه

برای انتشار Video Discovery Data، یک درخواست POST به API publishContinuationCluster با استفاده از نحو زیر انجام دهید.

https://tvvideodiscovery.googleapis.com/v1/packages/{package_name}/accounts/{account_id}/profiles/{profile_id}/publishContinuationCluster

کجا:

  • package_name : نام بسته ارائه دهنده رسانه
  • accountId : شناسه منحصر به فرد برای حساب کاربر در سیستم شما. باید با accountId استفاده شده در مسیر روی دستگاه مطابقت داشته باشد.
  • profileId : شناسه منحصر به فرد برای نمایه کاربر در حساب کاربری در سیستم شما. باید با profileId استفاده شده در مسیر روی دستگاه مطابقت داشته باشد.

URL برای حساب بدون نمایه این است:

https://tvvideodiscovery.googleapis.com/v1/packages/{package_name}/accounts/{account_id}/publishContinuationCluster

محموله به درخواست در قسمت entities نشان داده می شود. entities فهرستی از موجودیت های محتوا را نشان می دهد که می تواند MovieEntity یا TVEpisodeEntity باشد. این یک فیلد الزامی است.

درخواست بدن

میدان

تایپ کنید

مورد نیاز

توضیحات

نهادها

فهرست اشیاء MediaEntity

بله

فهرست موجودیت‌های محتوا (حداکثر 5)، فقط پنج مورد برتر حفظ می‌شوند و بقیه حذف می‌شوند. فهرست خالی مجاز است به این معنی که کاربر تماشای همه موجودیت‌ها را به پایان رسانده است.

entities فیلد حاوی movieEntity و tvEpisodeEntity هستند.

میدان

تایپ کنید

مورد نیاز

توضیحات

فیلم موجودیت

MovieEntity

بله

یک شی که نمایانگر یک فیلم در ContinuationCluster است.

tvEpisodeEntity

TVEpisodeEntity

بله

یک شی که نمایانگر یک قسمت تلویزیونی در ContinuationCluster است.

هر شیء در آرایه موجودیت ها باید یکی از انواع MediaEntity موجود یعنی MovieEntity و TvEpisodeEntity به همراه فیلدهای مشترک و نوع خاص باشد.

قطعه کد زیر بار بدنه درخواست را برای publishContinuationCluster API نمایش می دهد.

{
  "entities": [
    {
      "movieEntity": {
        "watch_next_type": "WATCH_NEXT_TYPE_CONTINUE",
        "name": "Movie1",
        "platform_specific_playback_uris": [
          "https://www.example.com/entity_uri_for_android",
          "https://www.example.com/entity_uri_for_iOS"
        ],
        "poster_images": [
          "http://www.example.com/movie1_img1.png",
          "http://www.example.com/movie1_imag2.png"
        ],
        "last_engagement_time_millis": 864600000,
        "duration_millis": 5400000,
        "last_play_back_position_time_millis": 3241111
      }
    },
    {
      "tvEpisodeEntity": {
        "watch_next_type": "WATCH_NEXT_TYPE_CONTINUE",
        "name": "TV SERIES EPISODE 1",
        "platform_specific_playback_uris": [
          "https://www.example.com/entity_uri_for_android",
          "https://www.example.com/entity_uri_for_iOS"
        ],
        "poster_images": [
          "http://www.example.com/episode1_img1.png",
          "http://www.example.com/episode1_imag2.png"
        ],
        "last_engagement_time_millis": 864600000,
        "duration_millis": 1800000,
        "last_play_back_position_time_millis": 2141231,
        "episode_display_number": "1",
        "season_number": "1",
        "show_title": "title"
      }
    }
  ]
}

داده های کشف ویدیو را حذف کنید

برای حذف داده های کشف ویدیو از clearClusters API استفاده کنید.

از POST URL برای حذف موجودیت ها از داده های کشف ویدیو استفاده کنید. برای حذف داده‌های کلاستر ادامه، با استفاده از دستور زیر، یک درخواست POST به API clearClusters انجام دهید.

https://tvvideodiscovery.googleapis.com/v1/packages/{package_name}/accounts/{account_id}/profiles/{profile_id}/clearClusters

کجا:

  • package_name : نام بسته ارائه دهنده رسانه.
  • accountId : شناسه منحصر به فرد برای حساب کاربر در سیستم شما. باید با accountId استفاده شده در مسیر روی دستگاه مطابقت داشته باشد.
  • profileId : شناسه منحصر به فرد برای نمایه کاربر در حساب کاربری در سیستم شما. باید با profileId استفاده شده در مسیر روی دستگاه مطابقت داشته باشد.

محموله برای clearClusters API تنها حاوی یک فیلد، reason است که حاوی یک DeleteReason است که دلیل حذف داده ها را مشخص می کند.

{
  "reason": "DELETE_REASON_LOSS_OF_CONSENT"
}

تست کردن

پس از ارسال موفقیت آمیز داده ها، از یک حساب آزمایشی کاربر استفاده کنید تا تأیید کنید که محتوای مورد انتظار در ردیف "ادامه تماشا" در سطوح هدف Google مانند Google TV و برنامه های تلفن همراه Android و iOS Google TV ظاهر می شود.

در آزمایش، یک تاخیر معقول چند دقیقه ای در انتشار بگذارید و به الزامات تماشا، مانند تماشای بخشی از یک فیلم یا اتمام یک قسمت، پایبند باشید. برای جزئیات بیشتر ، دستورالعمل‌های Watch Next را برای توسعه‌دهندگان برنامه‌ها ببینید.

دانلود کنید

قبل از دانلود، باید با شرایط و ضوابط زیر موافقت کنید.

شرایط و ضوابط

This is the Android Software Development Kit License Agreement

1. Introduction

1.1 The Android Software Development Kit (referred to in the License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK. 1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: https://source.android.com/, as updated from time to time. 1.3 A "compatible implementation" means any Android device that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (https://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS). 1.4 "Google" means Google LLC, organized under the laws of the State of Delaware, USA, and operating under the laws of the USA with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, USA.

2. Accepting this License Agreement

2.1 In order to use the SDK, you must first agree to the License Agreement. You may not use the SDK if you do not accept the License Agreement. 2.2 By clicking to accept and/or using this SDK, you hereby agree to the terms of the License Agreement. 2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries, including the country in which you are resident or from which you use the SDK. 2.4 If you are agreeing to be bound by the License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.

3. SDK License from Google

3.1 Subject to the terms of the License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android. 3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this SDK is not used for that purpose. 3.3 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. 3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. 3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. 3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you. 3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. 3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.

4. Use of the SDK by You

4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications. 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) the License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). 4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so. 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier. 4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.

5. Your Developer Credentials

5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.

6. Privacy and Information

6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected. 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy, which is located at the following URL: https://policies.google.com/privacy 6.3 Anonymized and aggregated sets of the data may be shared with Google partners to improve the SDK.

7. Third Party Applications

7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. 7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, the License Agreement does not affect your legal relationship with these third parties.

8. Using Android APIs

8.1 Google Data APIs 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. 8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. If you use the Android Recognition Service API, documented at the following URL: https://developer.android.com/reference/android/speech/RecognitionService, as updated from time to time, you acknowledge that the use of the API is subject to the Data Processing Addendum for Products where Google is a Data Processor, which is located at the following URL: https://privacy.google.com/businesses/gdprprocessorterms/, as updated from time to time. By clicking to accept, you hereby agree to the terms of the Data Processing Addendum for Products where Google is a Data Processor.

9. Terminating this License Agreement

9.1 The License Agreement will continue to apply until terminated by either you or Google as set out below. 9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials. 9.3 Google may at any time, terminate the License Agreement with you if: (A) you have breached any provision of the License Agreement; or (B) Google is required to do so by law; or (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or (D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable. 9.4 When the License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst the License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.

10. DISCLAIMER OF WARRANTIES

10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.

11. LIMITATION OF LIABILITY

11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.

12. Indemnification

12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with the License Agreement.

13. Changes to the License Agreement

13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available. 14.1 The License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK. 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable. 14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement. 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. 14.6 The rights granted in the License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under the License Agreement without the prior written approval of the other party. 14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. July 27, 2021
دانلود کنید

verify_app_multiplatform_public_20250602.apk