playurl.go 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package model
  2. // Otype playurl data type.
  3. const (
  4. OtypeJSON = "json"
  5. OtypeXML = "xml"
  6. )
  7. // PlayurlArg playurl arg.
  8. type PlayurlArg struct {
  9. Cid int64 `form:"cid" validate:"min=1"`
  10. Aid int64 `form:"avid" validate:"min=1"`
  11. Qn int `form:"qn"`
  12. Type string `form:"type"`
  13. MaxBackup int `form:"max_backup"`
  14. Npcybs int `form:"npcybs"`
  15. Platform string `form:"platform"`
  16. Player int `form:"player"`
  17. Buvid string `form:"buvid"`
  18. Resolution string `form:"resolution"`
  19. Model string `form:"model"`
  20. Build int `form:"build"`
  21. OType string `form:"otype"`
  22. Fnver int `form:"fnver"`
  23. Fnval int `form:"fnval"`
  24. Session string `form:"session"`
  25. HTML5 int `form:"html5"`
  26. H5GoodQuality int `form:"h5_good_quality"`
  27. HighQuality int `form:"high_quality"`
  28. }
  29. // PlayurlRes playurl res.
  30. type PlayurlRes struct {
  31. From string `json:"from" xml:"from"`
  32. Result string `json:"result" xml:"result"`
  33. Message string `json:"message" xml:"message"`
  34. Quality int `json:"quality" xml:"quality"`
  35. Format string `json:"format" xml:"format"`
  36. Timelength int64 `json:"timelength" xml:"timelength"`
  37. AcceptFormat string `json:"accept_format" xml:"accept_format"`
  38. AcceptDescription []string `json:"accept_description" xml:"accept_description"`
  39. AcceptQuality []int `json:"accept_quality" xml:"accept_quality"`
  40. VideoCodeCid int64 `json:"video_codecid" xml:"video_codecid"`
  41. SeekParam string `json:"seek_param" xml:"seek_param"`
  42. SeekType string `json:"seek_type" xml:"seek_type"`
  43. Abtid int64 `json:"abtid,omitempty" xml:"abtid,omitempty"`
  44. Durl []*struct {
  45. Order int `json:"order" xml:"order"`
  46. Length int64 `json:"length" xml:"length"`
  47. Size int64 `json:"size" xml:"size"`
  48. Ahead string `json:"ahead" xml:"ahead"`
  49. Vhead string `json:"vhead" xml:"vhead"`
  50. URL string `json:"url" xml:"url"`
  51. BackupURL []string `json:"backup_url" xml:"backup_url"`
  52. } `json:"durl,omitempty" xml:"durl,omitempty"`
  53. Dash *struct {
  54. Duration int64 `json:"duration"`
  55. MinBufferTime float64 `json:"minBufferTime"`
  56. Video []*DashItem `json:"video"`
  57. Audio []*DashItem `json:"audio"`
  58. } `json:"dash,omitempty" xml:"dash,omitempty"`
  59. }
  60. // DashItem .
  61. type DashItem struct {
  62. ID int64 `json:"id" xml:"id"`
  63. BaseURL string `json:"baseUrl" xml:"baseUrl"`
  64. BackupURL []string `json:"backupUrl" xml:"backupUrl"`
  65. Bandwidth int64 `json:"bandwidth" xml:"bandwidth"`
  66. MimeType string `json:"mimeType" xml:"mimeType"`
  67. Codecs string `json:"codecs" xml:"codecs"`
  68. Width int64 `json:"width" xml:"width"`
  69. Height int64 `json:"height" xml:"height"`
  70. FrameRate string `json:"frameRate" xml:"frameRate"`
  71. Sar string `json:"sar" xml:"sar"`
  72. StartWithSAP int64 `json:"startWithSap" xml:"startWithSap"`
  73. SegmentBase *struct {
  74. Initialization string `json:"Initialization" xml:"Initialization"`
  75. IndexRange string `json:"indexRange" xml:"indexRange"`
  76. } `json:"SegmentBase" xml:"SegmentBase"`
  77. Codecid int64 `json:"codecid" xml:"codecid"`
  78. }