您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

69 行
2.6 KiB

  1. //
  2. // UniWebViewChannelMethodMediaCapturePermission.cs
  3. // Created by Wang Wei(@onevcat) on 2024-02-20.
  4. //
  5. // This file is a part of UniWebView Project (https://uniwebview.com)
  6. // By purchasing the asset, you are allowed to use this code in as many as projects
  7. // you want, only if you publish the final products under the name of the same account
  8. // used for the purchase.
  9. //
  10. // This asset and all corresponding files (such as source code) are provided on an
  11. // “as is” basis, without warranty of any kind, express of implied, including but not
  12. // limited to the warranties of merchantability, fitness for a particular purpose, and
  13. // noninfringement. In no event shall the authors or copyright holders be liable for any
  14. // claim, damages or other liability, whether in action of contract, tort or otherwise,
  15. // arising from, out of or in connection with the software or the use of other dealing in the software.
  16. //
  17. using System;
  18. using UnityEngine;
  19. /// <summary>
  20. /// Represents the request of media capture permission.
  21. ///
  22. /// This class represents the request of media capture permission. When the web page requests the permission to access
  23. /// the device's hardware, such as the camera or microphone, UniWebView will ask you to handle the request with a value
  24. /// of this class. You can use the values in this class to determine the decision for the permission request.
  25. /// </summary>
  26. [Serializable]
  27. public class UniWebViewChannelMethodMediaCapturePermission {
  28. [SerializeField]
  29. private string protocol;
  30. [SerializeField]
  31. private string host;
  32. [SerializeField]
  33. private int port;
  34. [SerializeField]
  35. private string[] resources;
  36. /// <summary>
  37. /// The protocol used by the permission request. Such as "https" or "http".
  38. /// </summary>
  39. public string Protocol => protocol;
  40. /// <summary>
  41. /// The host of the origin of the permission request.
  42. ///
  43. /// It is usually the domain of the web page.
  44. /// </summary>
  45. public string Host => host;
  46. /// <summary>
  47. /// The port of the origin of the permission request.
  48. ///
  49. /// If not existing in the request URL, it is -1.
  50. /// </summary>
  51. public int Port => port;
  52. /// <summary>
  53. /// The string representation of the resources of the origin of the permission request.
  54. ///
  55. /// An array contains requested resources, the most common values are "VIDEO", "AUDIO". On Android, some pages can
  56. /// also requests for "PROTECTED_MEDIA_ID", "MIDI_SYSEX", etc.
  57. /// </summary>
  58. public string[] Resources => resources;
  59. }