summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/SevereCloud/vksdk/v2/object/video.go
blob: 0816af2457f4a8cda085a8a0bc8778a7ac42261b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
package object // import "github.com/SevereCloud/vksdk/v2/object"

import (
	"fmt"
)

// VideoVideo struct.
type VideoVideo struct {
	// Video access key.
	AccessKey string `json:"access_key"`

	// Date when the video has been added in Unixtime.
	AddingDate int `json:"adding_date"`

	// Information whether current user can add the video.
	CanAdd BaseBoolInt `json:"can_add"`

	// Information whether current user can add the video to faves.
	CanAddToFaves BaseBoolInt `json:"can_add_to_faves"`

	// Information whether current user can comment the video.
	CanComment BaseBoolInt `json:"can_comment"`

	// Information whether current user can edit the video.
	CanEdit BaseBoolInt `json:"can_edit"`

	// Information whether current user can like the video.
	CanLike BaseBoolInt `json:"can_like"`

	// Information whether current user can repost this video.
	CanRepost         BaseBoolInt       `json:"can_repost"`
	CanSubscribe      BaseBoolInt       `json:"can_subscribe"`
	CanAttachLink     BaseBoolInt       `json:"can_attach_link"`
	IsFavorite        BaseBoolInt       `json:"is_favorite"`
	IsPrivate         BaseBoolInt       `json:"is_private"`
	Added             BaseBoolInt       `json:"added"`
	Repeat            BaseBoolInt       `json:"repeat"` // Information whether the video is repeated
	ContentRestricted int               `json:"content_restricted"`
	Live              BaseBoolInt       `json:"live"` // Returns if the video is a live stream
	Upcoming          BaseBoolInt       `json:"upcoming"`
	Comments          int               `json:"comments"`    // Number of comments
	Date              int               `json:"date"`        // Date when video has been uploaded in Unixtime
	Description       string            `json:"description"` // Video description
	Duration          int               `json:"duration"`    // Video duration in seconds
	Files             VideoVideoFiles   `json:"files"`
	FirstFrame        []VideoVideoImage `json:"first_frame"`
	Image             []VideoVideoImage `json:"image"`
	Height            int               `json:"height"`   // Video height
	ID                int               `json:"id"`       // Video ID
	OwnerID           int               `json:"owner_id"` // Video owner ID
	UserID            int               `json:"user_id"`
	Photo130          string            `json:"photo_130"`  // URL of the preview image with 130 px in width
	Photo320          string            `json:"photo_320"`  // URL of the preview image with 320 px in width
	Photo640          string            `json:"photo_640"`  // URL of the preview image with 640 px in width
	Photo800          string            `json:"photo_800"`  // URL of the preview image with 800 px in width
	Photo1280         string            `json:"photo_1280"` // URL of the preview image with 1280 px in width

	// URL of the page with a player that can be used to play the video in the browser.
	Player                   string            `json:"player"`
	Processing               int               `json:"processing"` // Returns if the video is processing
	Title                    string            `json:"title"`      // Video title
	Type                     string            `json:"type"`
	Views                    int               `json:"views"` // Number of views
	Width                    int               `json:"width"` // Video width
	Platform                 string            `json:"platform"`
	LocalViews               int               `json:"local_views"`
	Likes                    BaseLikesInfo     `json:"likes"`   // Count of likes
	Reposts                  BaseRepostsInfo   `json:"reposts"` // Count of views
	TrackCode                string            `json:"track_code"`
	PrivacyView              Privacy           `json:"privacy_view"`
	PrivacyComment           Privacy           `json:"privacy_comment"`
	ActionButton             VideoActionButton `json:"action_button"`
	Restriction              VideoRestriction  `json:"restriction"`
	ContentRestrictedMessage string            `json:"content_restricted_message"`
}

// ToAttachment return attachment format.
func (video VideoVideo) ToAttachment() string {
	return fmt.Sprintf("video%d_%d", video.OwnerID, video.ID)
}

// VideoRestriction struct.
type VideoRestriction struct {
	Title          string      `json:"title"`
	Text           string      `json:"text"`
	AlwaysShown    BaseBoolInt `json:"always_shown"`
	Blur           BaseBoolInt `json:"blur"`
	CanPlay        BaseBoolInt `json:"can_play"`
	CanPreview     BaseBoolInt `json:"can_preview"`
	CardIcon       []BaseImage `json:"card_icon"`
	ListIcon       []BaseImage `json:"list_icon"`
	DisclaimerType int         `json:"disclaimer_type"`
}

// VideoActionButton struct.
type VideoActionButton struct {
	ID      string       `json:"id"`
	Type    string       `json:"type"`
	URL     string       `json:"url"`
	Snippet VideoSnippet `json:"snippet"`
}

// VideoSnippet struct.
type VideoSnippet struct {
	Description string      `json:"description"`
	OpenTitle   string      `json:"open_title"`
	Title       string      `json:"title"`
	TypeName    string      `json:"type_name"`
	Date        int         `json:"date"`
	Image       []BaseImage `json:"image"`
}

// VideoVideoFiles struct.
type VideoVideoFiles struct {
	External string `json:"external"` // URL of the external player
	Mp4_1080 string `json:"mp4_1080"` // URL of the mpeg4 file with 1080p quality
	Mp4_1440 string `json:"mp4_1440"` // URL of the mpeg4 file with 2k quality
	Mp4_2160 string `json:"mp4_2160"` // URL of the mpeg4 file with 4k quality
	Mp4_240  string `json:"mp4_240"`  // URL of the mpeg4 file with 240p quality
	Mp4_360  string `json:"mp4_360"`  // URL of the mpeg4 file with 360p quality
	Mp4_480  string `json:"mp4_480"`  // URL of the mpeg4 file with 480p quality
	Mp4_720  string `json:"mp4_720"`  // URL of the mpeg4 file with 720p quality
	Live     string `json:"live"`
	HLS      string `json:"hls"`
}

// VideoCatBlock struct.
type VideoCatBlock struct {
	CanHide BaseBoolInt       `json:"can_hide"`
	ID      int               `json:"id"`
	Items   []VideoCatElement `json:"items"`
	Name    string            `json:"name"`
	Next    string            `json:"next"`
	Type    string            `json:"type"`
	View    string            `json:"view"`
}

// VideoCatElement struct.
type VideoCatElement struct {
	CanAdd      BaseBoolInt `json:"can_add"`
	CanEdit     BaseBoolInt `json:"can_edit"`
	IsPrivate   BaseBoolInt `json:"is_private"`
	Comments    int         `json:"comments"`
	Count       int         `json:"count"`
	Date        int         `json:"date"`
	Description string      `json:"description"`
	Duration    int         `json:"duration"`
	ID          int         `json:"id"`
	OwnerID     int         `json:"owner_id"`
	Photo130    string      `json:"photo_130"`
	Photo160    string      `json:"photo_160"`
	Photo320    string      `json:"photo_320"`
	Photo640    string      `json:"photo_640"`
	Photo800    string      `json:"photo_800"`
	Title       string      `json:"title"`
	Type        string      `json:"type"`
	UpdatedTime int         `json:"updated_time"`
	Views       int         `json:"views"`
}

// VideoSaveResult struct.
type VideoSaveResult struct {
	Description string `json:"description"` // Video description
	OwnerID     int    `json:"owner_id"`    // Video owner ID
	Title       string `json:"title"`       // Video title
	UploadURL   string `json:"upload_url"`  // URL for the video uploading
	VideoID     int    `json:"video_id"`    // Video ID
	AccessKey   string `json:"access_key"`  // Video access key
}

// VideoUploadResponse struct.
type VideoUploadResponse struct {
	Size    int `json:"size"`
	VideoID int `json:"video_id"`
}

// VideoVideoAlbum struct.
type VideoVideoAlbum struct {
	ID      int    `json:"id"`
	OwnerID int    `json:"owner_id"`
	Title   string `json:"title"`
}

// VideoVideoAlbumFull struct.
type VideoVideoAlbumFull struct {
	Count       int               `json:"count"`        // Total number of videos in album
	ID          int               `json:"id"`           // Album ID
	Image       []VideoVideoImage `json:"image"`        // Album cover image in different sizes
	IsSystem    BaseBoolInt       `json:"is_system"`    // Information whether album is system
	OwnerID     int               `json:"owner_id"`     // Album owner's ID
	Photo160    string            `json:"photo_160"`    // URL of the preview image with 160px in width
	Photo320    string            `json:"photo_320"`    // URL of the preview image with 320px in width
	Title       string            `json:"title"`        // Album title
	UpdatedTime int               `json:"updated_time"` // Date when the album has been updated last time in Unixtime
	ImageBlur   int               `json:"image_blur"`
	Privacy     Privacy           `json:"privacy"`
}

// VideoVideoFull struct.
type VideoVideoFull struct {
	AccessKey     string          `json:"access_key"`  // Video access key
	AddingDate    int             `json:"adding_date"` // Date when the video has been added in Unixtime
	IsFavorite    BaseBoolInt     `json:"is_favorite"`
	CanAdd        BaseBoolInt     `json:"can_add"`     // Information whether current user can add the video
	CanComment    BaseBoolInt     `json:"can_comment"` // Information whether current user can comment the video
	CanEdit       BaseBoolInt     `json:"can_edit"`    // Information whether current user can edit the video
	CanRepost     BaseBoolInt     `json:"can_repost"`  // Information whether current user can comment the video
	CanLike       BaseBoolInt     `json:"can_like"`
	CanAddToFaves BaseBoolInt     `json:"can_add_to_faves"`
	Repeat        BaseBoolInt     `json:"repeat"`      // Information whether the video is repeated
	Comments      int             `json:"comments"`    // Number of comments
	Date          int             `json:"date"`        // Date when video has been uploaded in Unixtime
	Description   string          `json:"description"` // Video description
	Duration      int             `json:"duration"`    // Video duration in seconds
	Files         VideoVideoFiles `json:"files"`
	ID            int             `json:"id"` // Video ID
	Likes         BaseLikes       `json:"likes"`
	Live          int             `json:"live"`     // Returns if the video is live translation
	OwnerID       int             `json:"owner_id"` // Video owner ID

	// URL of the page with a player that can be used to play the video in the browser.
	Player     string            `json:"player"`
	Processing int               `json:"processing"` // Returns if the video is processing
	Title      string            `json:"title"`      // Video title
	Views      int               `json:"views"`      // Number of views
	Width      int               `json:"width"`
	Height     int               `json:"height"`
	Image      []VideoVideoImage `json:"image"`
	FirstFrame []VideoVideoImage `json:"first_frame"`
	Added      int               `json:"added"`
	Type       string            `json:"type"`
	Reposts    BaseRepostsInfo   `json:"reposts"`
}

// ToAttachment return attachment format.
func (video VideoVideoFull) ToAttachment() string {
	return fmt.Sprintf("video%d_%d", video.OwnerID, video.ID)
}

// VideoVideoTag struct.
type VideoVideoTag struct {
	Date       int         `json:"date"`
	ID         int         `json:"id"`
	PlacerID   int         `json:"placer_id"`
	TaggedName string      `json:"tagged_name"`
	UserID     int         `json:"user_id"`
	Viewed     BaseBoolInt `json:"viewed"`
}

// VideoVideoTagInfo struct.
type VideoVideoTagInfo struct {
	AccessKey   string          `json:"access_key"`
	AddingDate  int             `json:"adding_date"`
	CanAdd      BaseBoolInt     `json:"can_add"`
	CanEdit     BaseBoolInt     `json:"can_edit"`
	Comments    int             `json:"comments"`
	Date        int             `json:"date"`
	Description string          `json:"description"`
	Duration    int             `json:"duration"`
	Files       VideoVideoFiles `json:"files"`
	ID          int             `json:"id"`
	Live        int             `json:"live"`
	OwnerID     int             `json:"owner_id"`
	Photo130    string          `json:"photo_130"`
	Photo320    string          `json:"photo_320"`
	Photo800    string          `json:"photo_800"`
	PlacerID    int             `json:"placer_id"`
	Player      string          `json:"player"`
	Processing  int             `json:"processing"`
	TagCreated  int             `json:"tag_created"`
	TagID       int             `json:"tag_id"`
	Title       string          `json:"title"`
	Views       int             `json:"views"`
}

// VideoVideoImage struct.
type VideoVideoImage struct {
	BaseImage
	WithPadding BaseBoolInt `json:"with_padding"`
}