ServiceRtc.php 851 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Easemob\Agora;
  3. /**
  4. * @ignore
  5. */
  6. class ServiceRtc extends Service
  7. {
  8. const SERVICE_TYPE = 1;
  9. const PRIVILEGE_JOIN_CHANNEL = 1;
  10. const PRIVILEGE_PUBLISH_AUDIO_STREAM = 2;
  11. const PRIVILEGE_PUBLISH_VIDEO_STREAM = 3;
  12. const PRIVILEGE_PUBLISH_DATA_STREAM = 4;
  13. public $channelName;
  14. public $uid;
  15. public function __construct($channelName = "", $uid = "")
  16. {
  17. parent::__construct(self::SERVICE_TYPE);
  18. $this->channelName = $channelName;
  19. $this->uid = $uid;
  20. }
  21. public function pack()
  22. {
  23. return parent::pack() . Util::packString($this->channelName) . Util::packString($this->uid);
  24. }
  25. public function unpack(&$data)
  26. {
  27. parent::unpack($data);
  28. $this->channelName = Util::unpackString($data);
  29. $this->uid = Util::unpackString($data);
  30. }
  31. }