UploadVideoRequest.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?php
  2. /**
  3. * Class UploadVideoRequest
  4. *
  5. * Aliyun VoD's Upload Video Request class, which wraps parameters to upload a video into VoD.
  6. * Users could pass parameters to AliyunVodUploader, including File Path,Title,etc. via an UploadVideoRequest instance.
  7. * For more details, please check out the VoD API document: https://help.aliyun.com/document_detail/55407.html
  8. */
  9. class UploadVideoRequest
  10. {
  11. /**
  12. * UploadVideoRequest constructor.
  13. * @param $filePath
  14. * @param null $title
  15. * @throws Exception
  16. */
  17. public function __construct($filePath, $title=null) {
  18. $this->setFilePath($filePath, $title);
  19. }
  20. public function getFilePath() {
  21. return $this->filePath;
  22. }
  23. public function setFilePath($filePath, $title=null) {
  24. $this->filePath = $filePath;
  25. $fns = AliyunVodUtils::getFileName($this->filePath);
  26. $this->fileName = $fns[0];
  27. $extName = AliyunVodUtils::getFileExtension($this->fileName);
  28. if (empty($extName)) {
  29. throw new Exception('filePath has no Extension', 'InvalidParameter');
  30. }
  31. $this->mediaExt = $extName;
  32. if (isset($title)) {
  33. $this->title = $title;
  34. }
  35. else {
  36. if (!isset($this->title)) {
  37. $this->title = $fns[1];
  38. }
  39. }
  40. }
  41. public function getTitle() {
  42. return $this->title;
  43. }
  44. public function getMediaExt() {
  45. return $this->mediaExt;
  46. }
  47. public function setTitle($title) {
  48. $this->title = $title;
  49. }
  50. public function getFileName() {
  51. return $this->fileName;
  52. }
  53. public function getCateId() {
  54. return $this->cateId;
  55. }
  56. public function setCateId($cateId) {
  57. $this->cateId = $cateId;
  58. }
  59. public function getTags() {
  60. return $this->tags;
  61. }
  62. public function setTags($tags) {
  63. $this->tags = $tags;
  64. }
  65. public function getDescription() {
  66. return $this->description;
  67. }
  68. public function setDescription($description) {
  69. $this->description = $description;
  70. }
  71. public function getCoverURL() {
  72. return $this->coverURL;
  73. }
  74. public function setCoverURL($coverURL) {
  75. $this->coverURL = $coverURL;
  76. }
  77. public function getTemplateGroupId() {
  78. return $this->templateGroupId;
  79. }
  80. public function setTemplateGroupId($templateGroupId) {
  81. $this->templateGroupId = $templateGroupId;
  82. }
  83. public function getIsShowWatermark() {
  84. return $this->isShowWatermark;
  85. }
  86. // 关闭水印,仅用于配置全局水印且转码模板开启水印后,单次上传时关闭水印
  87. public function shutdownWatermark() {
  88. $this->isShowWatermark = false;
  89. }
  90. public function getWatermarkSwitch() {
  91. return $this->isShowWatermark;
  92. }
  93. public function getStorageLocation() {
  94. return $this->storageLocation;
  95. }
  96. public function setStorageLocation($storageLocation) {
  97. $this->storageLocation = $storageLocation;
  98. }
  99. public function getUserData() {
  100. return $this->userData;
  101. }
  102. public function setUserData($userData) {
  103. $this->userData = $userData;
  104. }
  105. public function getAppId() {
  106. return $this->appId;
  107. }
  108. public function setAppId($appId) {
  109. $this->appId = $appId;
  110. }
  111. public function getWorkflowId() {
  112. return $this->workflowId;
  113. }
  114. public function setWorkflowId($WorkflowId) {
  115. $this->workflowId = $WorkflowId;
  116. }
  117. private $filePath = null;
  118. private $title = null;
  119. private $fileName = null;
  120. private $mediaExt = null;
  121. private $cateId = null;
  122. private $tags = null;
  123. private $description = null;
  124. private $coverURL = null;
  125. private $templateGroupId = null;
  126. private $isShowWatermark = null;
  127. private $storageLocation = null;
  128. private $userData = null;
  129. private $appId = null;
  130. private $workflowId = null;
  131. }