GCKSessionTraits Class
Stay organized with collections
Save and categorize content based on your preferences.
An object describing the traits and capabilities of a session.
- Since
- 3.0
Inherits NSObject, <NSCopying>, and <NSSecureCoding>.
- (instancetype) initWithMinimumVolume: |
|
(float) |
minimumVolume |
maximumVolume: |
|
(float) |
maximumVolume |
volumeIncrement: |
|
(float) |
volumeIncrement |
supportsMuting: |
|
(BOOL) |
supportsMuting |
|
|
| |
Convenience initializer.
Sets the volume range to [0.0, 1.0], the volume increment to 0.05 (5%), and the supportsMuting flag to YES
.
Whether this is a fixed volume device.
The minimum volume value.
Must be non-negative and less than or equal to the maximum volume.
The maximum volume value.
Must be non-negative and greater than or equal to the minimum volume.
- (float) volumeIncrement |
|
readnonatomicassign |
The volume increment for up/down volume adjustments.
May 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.
Whether the audio can be muted.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 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."]]