Lớp GCKSessionTraits
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Đối tượng mô tả các đặc điểm và khả năng của một phiên.
- Năm thành lập
- 3
Kế thừa NSObject, <NSCopying> và <NSSecureCoding>.
- (instancetype) initWithMinimumVolume: |
|
(float) |
minimumVolume |
maximumVolume: |
|
(float) |
maximumVolume |
volumeIncrement: |
|
(float) |
volumeIncrement |
supportsMuting: |
|
(BOOL) |
supportsMuting |
|
|
| |
Trình khởi tạo được chỉ định.
Trình khởi tạo tiện lợi.
Đặt phạm vi âm lượng thành [0,0, 1,0], mức tăng âm lượng thành 0,05 (5%) và cờ supportedMuting thành YES
.
Liệu đây có phải là thiết bị có âm lượng cố định hay không.
Giá trị âm lượng tối thiểu.
Phải là số không âm và nhỏ hơn hoặc bằng âm lượng tối đa.
Giá trị số lượng tối đa.
Phải là số không âm và lớn hơn hoặc bằng khối lượng tối thiểu.
- (float) volumeIncrement |
|
readnonatomicassign |
Mức tăng âm lượng cho các mức điều chỉnh âm lượng lên/xuống.
Có thể là 0 để biểu thị số lượng cố định. Phải là số không âm và nhỏ hơn hoặc bằng mức chênh lệch giữa âm lượng tối đa và âm lượng tối thiểu.
Liệu âm thanh có thể bị tắt tiếng hay không.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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."]]