stream.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <?php
  2. $live = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('live/info')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $status = array
  13. (
  14. 1 => '未开始',
  15. 2 => '直播中',
  16. 3 => '已结束',
  17. );
  18. $disabled = array
  19. (
  20. 1 => '启动',
  21. 2 => '禁播',
  22. );
  23. return array
  24. (
  25. # 表名
  26. 'name' => 'stream',
  27. # 显示给用户看的名称
  28. 'lang' => '直播流管理',
  29. 'order' => 2,
  30. 'end' => array
  31. (
  32. //'update' => 'live/lib/manage.createStream',
  33. 'insert' => 'live/lib/manage.createStream',
  34. 'update_disabled' => 'live/lib/manage.updateDisabled',
  35. ),
  36. # 数据结构
  37. 'struct' => array
  38. (
  39. 'id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => 'ID',
  43. 'default' => '',
  44. 'desc' => '',
  45. 'match' => 'is_numeric',
  46. 'search' => 'order',
  47. //'list' => true,
  48. ),
  49. 'live_id' => array
  50. (
  51. 'type' => 'int-11',
  52. 'name' => '所属直播云',
  53. 'default' => '1',
  54. 'desc' => '所属直播云',
  55. 'match' => 'is_numeric',
  56. 'update' => 'select',
  57. 'option' => $live,
  58. 'search' => 'select',
  59. //'list' => true,
  60. ),
  61. 'name' => array
  62. (
  63. 'type' => 'varchar-300',
  64. 'name' => '流名称',
  65. 'default' => '',
  66. 'desc' => '名称',
  67. 'match' => 'option',
  68. 'update' => 'text',
  69. 'search' => 'fulltext',
  70. 'list_name' => '流信息',
  71. 'list' => 'Dever::load("live/lib/manage.liveData", {id})',
  72. ),
  73. 'key' => array
  74. (
  75. 'type' => 'varchar-300',
  76. 'name' => '流标识-流标识在直播空间中唯一,可包含 字母、数字、中划线、下划线;1 ~ 200 个字符长,对应云上的流名称。
  77. ',
  78. 'default' => '',
  79. 'desc' => '流标识',
  80. 'match' => 'option',
  81. 'search' => 'fulltext',
  82. 'update' => 'text',
  83. //'list' => true,
  84. ),
  85. 'times' => array
  86. (
  87. 'type' => 'varchar-30',
  88. 'name' => '直播时长-直接输入小时数,默认为1个小时',
  89. 'default' => '1',
  90. 'desc' => '直播时长',
  91. 'match' => 'option',
  92. 'update' => 'text',
  93. //'list' => true,
  94. ),
  95. 'status' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '流状态',
  99. 'default' => '1',
  100. 'desc' => '流状态',
  101. 'match' => 'is_numeric',
  102. //'update' => 'select',
  103. 'option' => $status,
  104. 'search' => 'select',
  105. //'list' => true,
  106. ),
  107. 'live' => array
  108. (
  109. 'type' => 'varchar-800',
  110. 'name' => '推流地址',
  111. 'default' => '',
  112. 'desc' => '推流地址',
  113. 'match' => 'option',
  114. //'update' => 'text',
  115. 'list_name' => '直播地址',
  116. 'list' => 'Dever::load("live/lib/manage.live", {id})',
  117. ),
  118. 'url_rtmp' => array
  119. (
  120. 'type' => 'varchar-800',
  121. 'name' => '高清地址',
  122. 'default' => '',
  123. 'desc' => '直播地址',
  124. 'match' => 'option',
  125. //'update' => 'text',
  126. //'list' => true,
  127. ),
  128. 'url_hls' => array
  129. (
  130. 'type' => 'varchar-800',
  131. 'name' => '标清地址',
  132. 'default' => '',
  133. 'desc' => '标清地址',
  134. 'match' => 'option',
  135. //'update' => 'text',
  136. //'list' => true,
  137. ),
  138. 'url_hdl' => array
  139. (
  140. 'type' => 'varchar-800',
  141. 'name' => '普清地址',
  142. 'default' => '',
  143. 'desc' => '普清地址',
  144. 'match' => 'option',
  145. //'update' => 'text',
  146. //'list' => true,
  147. ),
  148. 'url_pic' => array
  149. (
  150. 'type' => 'varchar-800',
  151. 'name' => '直播截图地址',
  152. 'default' => '',
  153. 'desc' => '直播截图地址',
  154. 'match' => 'option',
  155. //'update' => 'text',
  156. //'list' => true,
  157. ),
  158. 'info' => array
  159. (
  160. 'type' => 'text-255',
  161. 'name' => '直播信息',
  162. 'default' => '',
  163. 'desc' => '直播信息',
  164. 'match' => 'option',
  165. //'update' => 'text',
  166. 'list' => 'Dever::load("live/lib/manage.liveInfo", {id})',
  167. ),
  168. 'disabled' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '禁播流',
  172. 'default' => '1',
  173. 'desc' => '禁播流',
  174. 'match' => 'is_numeric',
  175. //'update' => 'select',
  176. 'option' => $disabled,
  177. 'search' => 'select',
  178. 'list' => true,
  179. 'edit' => true,
  180. ),
  181. 'state' => array
  182. (
  183. 'type' => 'tinyint-1',
  184. 'name' => '状态',
  185. 'default' => '1',
  186. 'desc' => '请选择状态',
  187. 'match' => 'is_numeric',
  188. ),
  189. 'cdate' => array
  190. (
  191. 'type' => 'int-11',
  192. 'name' => '创建时间',
  193. 'match' => array('is_numeric', time()),
  194. 'desc' => '',
  195. # 只有insert时才生效
  196. 'insert' => true,
  197. //'search' => 'date',
  198. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  199. ),
  200. ),
  201. 'manage' => array
  202. (
  203. //'excel' => true,
  204. 'delete' => false,
  205. 'edit' => false,
  206. //'insert' => false,
  207. 'button' => array
  208. (
  209. '同步所有流' => 'live/lib/manage.getStream',
  210. ),
  211. ),
  212. 'request' => array
  213. (
  214. )
  215. );