موقعیت فعلی رسانه در چند ثانیه، یا شکستن موقعیت فعلی در صورت پخش شکست.
دولت گمرکی
شیء پوچ
حالت سفارشی کاربر، باید برای جدا کردن پخش و منطق رابط کاربری استفاده شود تا امکان اجرای کد UI مشابه در یک کنترل از راه دور فراهم شود. حالت را می توان با فراخوانی cast.framework.PlayerManager#sendCustomState تنظیم کرد
وضعیت نمایش
بولی
اینکه آیا فراداده پخش کننده (به عنوان مثال: عنوان، زمان جاری) باید نمایش داده شود یا خیر. اگر حداقل یک فیلد در ابرداده نمایش داده شود، درست خواهد بود. در برخی موارد، displayStatus درست است، اما قسمتهایی از ابرداده باید پنهان شود (یعنی عنوان رسانه در حالی که رسانه در جستجوی آن است). در این موارد می توان از css اضافی برای مخفی کردن آن عناصر استفاده کرد. برای مواردی که رسانه فقط صوتی است، این تقریباً همیشه صادق است. در مواردی که رسانه ویدیویی است، این درست زمانی خواهد بود که: (1) ویدیو در حال بارگیری، بافر کردن یا جستجو است (2) درخواست پخش در پنج ثانیه گذشته در حالی که رسانه از قبل در حال پخش است، (3) وجود دارد. درخواستی برای نشان دادن وضعیت در پنج ثانیه گذشته، یا (4) رسانه در پنج ثانیه آخر متوقف شد.
نوع نمایش
رشته
ویژگی تمایز بین انواع مختلف صفحه نمایش. تلویزیون پیش فرض است.
مدت زمان
عدد
مدت زمان رسانه بر حسب ثانیه، یا مدت زمان استراحت در صورت پخش استراحت.
isAtLiveEdge
بولی
مشخص کنید که آیا جریان رسانه در لبه زنده پخش می شود.
isBreakSkippable
بولی
نشان دهید که در لحظه کنونی می توان از کلیپ شکستن صرفنظر کرد. درست زمانی که WhenSkippable == 0.
زنده است
بولی
مشخص کنید که محتوا پخش زنده است یا خیر.
PlayingBreak است
بولی
نشان می دهد که گیرنده در حال پخش یک استراحت است.
جستجو میکند
بولی
نشان دهید که بازیکن در حال جستجو است (می تواند در حین بازی یا مکث باشد).
شناسه منحصر به فرد برای جلسه رسانه. هنگامی که یک درخواست بار جدید دریافت می شود، به روز می شود.
mediaStartAbsoluteTime
عدد پوچ
زمان مطلق (زمان دوره بر حسب ثانیه) را برای پخشهای زنده نشان میدهد. برای رویداد زنده، زمان شروع رویداد خواهد بود، در غیر این صورت با شروع پخش جریانی، از محدوده قابل جستجو شروع خواهد شد.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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"]],["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003ePlayerData\u003c/code\u003e provides essential information about the media being played, including its current state, position, and metadata.\u003c/p\u003e\n"],["\u003cp\u003eIt includes details like active track IDs, break information, playback rate, and supported media commands.\u003c/p\u003e\n"],["\u003cp\u003eIt offers data related to live streams, such as \u003ccode\u003eisAtLiveEdge\u003c/code\u003e and \u003ccode\u003eliveSeekableRange\u003c/code\u003e, as well as custom states for UI logic.\u003c/p\u003e\n"],["\u003cp\u003eProperties like \u003ccode\u003edisplayStatus\u003c/code\u003e and \u003ccode\u003edisplayType\u003c/code\u003e control how and what media information should be displayed.\u003c/p\u003e\n"],["\u003cp\u003eAccess media information, including title, duration, thumbnail URL, and metadata, through the \u003ccode\u003emedia\u003c/code\u003e and \u003ccode\u003emetadata\u003c/code\u003e properties.\u003c/p\u003e\n"]]],[],null,["# Class: PlayerData\n\ncast.[framework](/cast/docs/reference/web_receiver/cast.framework).[ui](/cast/docs/reference/web_receiver/cast.framework.ui).PlayerData\n=======================================================================================================================================\n\nclass static\n\nPlayer data. Provide the player media and break state.\n\nConstructor\n-----------\n\n### PlayerData\n\nnew\nPlayerData()\n\nProperties\n----------\n\n### activeTrackIds\n\nnon-null Array of number\n\nActive track ids of current media.\n\n### applicationData\n\nnullable [cast.framework.ui.ApplicationData](/cast/docs/reference/web_receiver/cast.framework.ui.ApplicationData)\n\nApplication data.\n\n### breakPercentagePositions\n\nnon-null Array of number\n\nArray of breaks positions in percentage.\nDeprecated - is not updated for breaks in live or dynamic breaks.\n\nDeprecated\n: Use the \\`breaks\\` property of\n [cast.framework.ui.PlayerData#media](/cast/docs/reference/web_receiver/cast.framework.ui.PlayerData#media) instead.\n\n### breakTitle\n\nstring\n\nTitle of the current playing break.\n\n### currentBreakClipNumber\n\nnumber\n\nThe number of the current playing break clip in the break.\n\n### currentTime\n\nnumber\n\nMedia current position in seconds, or break current position if playing\nbreak.\n\n### customState\n\nnullable Object\n\nUser custom state, Should be used to separate playback and UI logic,\nto allow same UI code to run in a remote control.\nThe state can be set by calling\n[cast.framework.PlayerManager#sendCustomState](/cast/docs/reference/web_receiver/cast.framework.PlayerManager#sendCustomState)\n\n### displayStatus\n\nboolean\n\nWhether the player metadata (ie: title, currentTime) should be displayed.\nThis will be true if at least one field in the metadata should be\ndisplayed. In some cases, displayStatus will be true, but parts of the\nmetadata should be hidden (ie: the media title while media is seeking).\nIn these cases, additional css can be applied to hide those elements. For\ncases where the media is audio-only, this will almost always be true. In\ncases where the media is video, this will be true when: (1) the video is\nloading, buffering, or seeking (2) a play request was made in the last\nfive seconds while media is already playing, (3) there is a request made\nto show the status in the last five seconds, or (4) the media was paused\nin the last five seconds.\n\n### displayType\n\nstring\n\nProperty to differentiate between different screen types. TV is default.\n\n### duration\n\nnumber\n\nMedia duration in seconds, Or break duration if playing break.\n\n### isAtLiveEdge\n\nboolean\n\nIndicate if the media stream is playing at live edge.\n\n### isBreakSkippable\n\nboolean\n\nIndicate that break clip can be skipped at the current moment. True when\nwhenSkippable == 0.\n\n### isLive\n\nboolean\n\nIndicate if the content is a live stream.\n\n### isPlayingBreak\n\nboolean\n\nIndicate that the receiver is playing a break.\n\n### isSeeking\n\nboolean\n\nIndicate the player is seeking (can be either during playing or pausing).\n\n### liveSeekableRange\n\nnullable [cast.framework.messages.LiveSeekableRange](/cast/docs/reference/web_receiver/cast.framework.messages.LiveSeekableRange)\n\nIndicate the seekable range of the content if it is a live stream.\n\n### media\n\n(nullable [cast.framework.messages.MediaInformation](/cast/docs/reference/web_receiver/cast.framework.messages.MediaInformation) or undefined)\n\nCurrent media information.\n\n### mediaCategory\n\nnullable [cast.framework.messages.MediaCategory](/cast/docs/reference/web_receiver/cast.framework.messages#.MediaCategory)\n\nThe media category (video, audio, or image).\n\n### mediaSessionId\n\nnumber\n\nUnique id for media session. It is updated when a new load request\nis received.\n\n### mediaStartAbsoluteTime\n\nnullable number\n\nIndicates absolute time (Epoch time in seconds) for live streams.\nFor live event it would be the time the event started, otherwise\nit will be start of the seekable range when the streaming started.\n\n### metadata\n\n(nullable [cast.framework.messages.MediaMetadata](/cast/docs/reference/web_receiver/cast.framework.messages.MediaMetadata) or nullable Object)\n\nMedia metadata.\n\n### nextMetadata\n\n(nullable [cast.framework.messages.MediaMetadata](/cast/docs/reference/web_receiver/cast.framework.messages.MediaMetadata) or nullable Object)\n\nNext item metadata.\n\n### nextSubtitle\n\nstring\n\nNext Item subtitle.\n\n### nextThumbnailUrl\n\nstring\n\nNext Item thumbnail url.\n\n### nextTitle\n\nstring\n\nNext Item title.\n\n### numberBreakClips\n\nnumber\n\nNumber of break clips in current break.\n\n### playbackRate\n\nnumber\n\nMedia playback rate.\n\n### preloadingNext\n\nboolean\n\nFlag to show/hide next item metadata.\n\n### queueData\n\n(nullable [cast.framework.messages.QueueData](/cast/docs/reference/web_receiver/cast.framework.messages.QueueData) or undefined)\n\nQueue data.\n\n### secondaryImageUrl\n\nstring\n\nContent secondary image url.\n\n### sectionDuration\n\nnullable number\n\nIndicate the section duration in seconds.\n\n### sectionStartTimeInMedia\n\nnullable number\n\nIndicate the section start time, in media time in seconds.\n\n### state\n\n[cast.framework.ui.State](/cast/docs/reference/web_receiver/cast.framework.ui#.State)\n\nCurrent player state.\n\n### supportedMediaCommands\n\nnumber\n\nThe commands supported by this player.\n\nSee also\n: [cast.framework.messages.Command](/cast/docs/reference/web_receiver/cast.framework.messages#.Command)\n\n### thumbnailUrl\n\nstring\n\nContent thumbnail url.\n\n### title\n\nstring\n\nContent title.\n\n### whenSkippable\n\n(number or undefined)\n\nProvide the time remaining till a break will become skippable relative\nto current playback time. Undefined or a negative value if break is not\nskippable."]]