ชั้นเรียน GCKSessionTraits
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
วัตถุที่อธิบายลักษณะและความสามารถของเซสชัน
- Since
- 3.0
รับค่า NSObject, <NSCopying> และ <NSSecureCoding>
- (instancetype) initWithMinimumVolume: |
|
(float) |
minimumVolume |
maximumVolume: |
|
(float) |
maximumVolume |
volumeIncrement: |
|
(float) |
volumeIncrement |
supportsMuting: |
|
(BOOL) |
supportsMuting |
|
|
| |
เครื่องมือเริ่มต้นที่กำหนด
เครื่องมือเริ่มต้นตามสะดวก
ตั้งช่วงระดับเสียงเป็น [0.0, 1.0] ปรับระดับเสียงเพิ่มเป็น 0.05 (5%) และรองรับธงปิดเสียงเป็น YES
อุปกรณ์นี้เป็นอุปกรณ์ที่มีระดับเสียงคงที่หรือไม่
ค่าระดับเสียงต่ำสุด
ต้องไม่ติดลบและน้อยกว่าหรือเท่ากับระดับเสียงสูงสุด
ค่าระดับเสียงสูงสุด
ต้องไม่ติดลบและมากกว่าหรือเท่ากับระดับเสียงขั้นต่ำ
- (float) volumeIncrement |
|
readnonatomicassign |
ปุ่มที่จะเพิ่ม/ลดระดับเสียง
อาจเป็น 0 เพื่อหมายถึงระดับเสียงคงที่ ต้องไม่ติดลบและน้อยกว่าหรือเท่ากับความแตกต่างระหว่างระดับเสียงสูงสุดและระดับเสียงต่ำสุด
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003e\u003ccode\u003eGCKSessionTraits\u003c/code\u003e describes the capabilities of a Cast session, such as volume control and mute support.\u003c/p\u003e\n"],["\u003cp\u003eIt provides properties for minimum/maximum volume, volume increment, and mute support.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use \u003ccode\u003eGCKSessionTraits\u003c/code\u003e to understand and manage the audio aspects of a Cast session.\u003c/p\u003e\n"],["\u003cp\u003eThis class inherits from \u003ccode\u003eNSObject\u003c/code\u003e, \u003ccode\u003eNSCopying\u003c/code\u003e, and \u003ccode\u003eNSSecureCoding\u003c/code\u003e, offering standard object functionalities.\u003c/p\u003e\n"],["\u003cp\u003eIncludes designated and convenience initializers to create \u003ccode\u003eGCKSessionTraits\u003c/code\u003e instances with default or custom settings.\u003c/p\u003e\n"]]],["The GCKSessionTraits class defines session capabilities, including volume control and muting. Key actions involve initializing session traits with minimum/maximum volume, volume increment, and muting support. It includes properties for `minimumVolume`, `maximumVolume`, `volumeIncrement`, and `supportsMuting`. It allows determining if a device has fixed volume using the method `isFixedVolume`. The convenience initializer sets default values for volume range, increment, and muting support.\n"],null,["# GCKSessionTraits Class\n\n[Instance Methods](#pub-methods) \\| [Properties](#properties) \nGCKSessionTraits Class Reference \n\nOverview\n--------\n\nAn object describing the traits and capabilities of a session.\n\nSince\n: 3.0\n\nInherits NSObject, \\\u003cNSCopying\\\u003e, and \\\u003cNSSecureCoding\\\u003e.\n\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (instancetype) | - [initWithMinimumVolume:maximumVolume:volumeIncrement:supportsMuting:](/cast/docs/reference/ios/interface_g_c_k_session_traits#aead7a055e391c18ce12151283ce46024) |\n| | Designated initializer. [More...](#aead7a055e391c18ce12151283ce46024) |\n| ||\n| (instancetype) | - [init](/cast/docs/reference/ios/interface_g_c_k_session_traits#acc7ceb4bd60b0e183835a28de81f30a4) |\n| | Convenience initializer. [More...](#acc7ceb4bd60b0e183835a28de81f30a4) |\n| ||\n| (BOOL) | - [isFixedVolume](/cast/docs/reference/ios/interface_g_c_k_session_traits#aefb739780f4ded760ebbeea03e64deb8) |\n| | Whether this is a fixed volume device. [More...](#aefb739780f4ded760ebbeea03e64deb8) |\n| ||\n\n|-------|--------------------------------------------------------------------------------------------------------------|\n| Property Summary ---------------- ||\n| float | [minimumVolume](/cast/docs/reference/ios/interface_g_c_k_session_traits#ac81be4b49f074d03ed2d7402545d8b48) |\n| | The minimum volume value. [More...](#ac81be4b49f074d03ed2d7402545d8b48) |\n| ||\n| float | [maximumVolume](/cast/docs/reference/ios/interface_g_c_k_session_traits#a804c278bdb1c889d0e3f8c2befb94f95) |\n| | The maximum volume value. [More...](#a804c278bdb1c889d0e3f8c2befb94f95) |\n| ||\n| float | [volumeIncrement](/cast/docs/reference/ios/interface_g_c_k_session_traits#af42670541270cf14d58d9f771112309b) |\n| | The volume increment for up/down volume adjustments. [More...](#af42670541270cf14d58d9f771112309b) |\n| ||\n| BOOL | [supportsMuting](/cast/docs/reference/ios/interface_g_c_k_session_traits#a264fc04b795b36bb41a42fc2c54f2380) |\n| | Whether the audio can be muted. [More...](#a264fc04b795b36bb41a42fc2c54f2380) |\n| ||\n\nMethod Detail\n-------------\n\n|-----------------------------------------|---|---------|-------------------|\n| - (instancetype) initWithMinimumVolume: | | (float) | *minimumVolume* |\n| maximumVolume: | | (float) | *maximumVolume* |\n| volumeIncrement: | | (float) | *volumeIncrement* |\n| supportsMuting: | | (BOOL) | *supportsMuting* |\n| | | | |\n\nDesignated initializer. \n\n|-----------------------|---|---|---|\n| - (instancetype) init | | | |\n\nConvenience initializer.\n\nSets the volume range to \\[0.0, 1.0\\], the volume increment to 0.05 (5%), and the supportsMuting flag to `YES`. \n\n|------------------------|---|---|---|\n| - (BOOL) isFixedVolume | | | |\n\nWhether this is a fixed volume device.\n\nProperty Detail\n---------------\n\n|---------------------------------------------------------|---------------------|\n| |-------------------------| | - (float) minimumVolume | | readnonatomicassign |\n\nThe minimum volume value.\n\nMust be non-negative and less than or equal to the maximum volume. \n\n|---------------------------------------------------------|---------------------|\n| |-------------------------| | - (float) maximumVolume | | readnonatomicassign |\n\nThe maximum volume value.\n\nMust be non-negative and greater than or equal to the minimum volume. \n\n|-------------------------------------------------------------|---------------------|\n| |---------------------------| | - (float) volumeIncrement | | readnonatomicassign |\n\nThe volume increment for up/down volume adjustments.\n\nMay be 0 to indicate fixed volume. Must be non-negative and less than or equal to the difference between the maximum volume and minimum volume. \n\n|---------------------------------------------------------|---------------------|\n| |-------------------------| | - (BOOL) supportsMuting | | readnonatomicassign |\n\nWhether the audio can be muted."]]