@pbvision/partner-sdk 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +6 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -62,13 +62,13 @@ export class PBVision {
|
|
|
62
62
|
* @param {VideoMetadata} [metadata]
|
|
63
63
|
* @returns {VideoUrlToDownloadResponse}
|
|
64
64
|
*/
|
|
65
|
-
async sendVideoUrlToDownload (videoUrl, { userEmails = [], name, desc, gameStartEpoch } = {}) {
|
|
65
|
+
async sendVideoUrlToDownload (videoUrl, { userEmails = [], name, desc, gameStartEpoch, facility, court } = {}) {
|
|
66
66
|
assert(typeof videoUrl === 'string' && videoUrl.startsWith('http'),
|
|
67
67
|
'URL must be a string beginning with http')
|
|
68
68
|
assert(videoUrl.split('?')[0].endsWith('.mp4'), 'video URL must have the .mp4 extension')
|
|
69
69
|
const resp = await this.__callAPI(
|
|
70
70
|
'add_video_by_url',
|
|
71
|
-
{ url: videoUrl, userEmails, name, desc, gameStartEpoch })
|
|
71
|
+
{ url: videoUrl, userEmails, name, desc, gameStartEpoch, facility, court })
|
|
72
72
|
return JSON.parse(resp)
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -100,6 +100,8 @@ export class PBVision {
|
|
|
100
100
|
* time of the game, or if that isn't provided then the time of the upload)
|
|
101
101
|
* @property {string} [desc] a longer description of the game
|
|
102
102
|
* @property {integer} [gameStartEpoch] the epoch at which the game started
|
|
103
|
+
* @property {string} [facility] the facility where the game was recorded (e.g., "Cool Club #3 - Barcelona")
|
|
104
|
+
* @property {string} [court] the court where the game was recorded (e.g., "11A")
|
|
103
105
|
*/
|
|
104
106
|
|
|
105
107
|
/**
|
|
@@ -112,10 +114,10 @@ export class PBVision {
|
|
|
112
114
|
* @param {VideoMetadata} [metadata]
|
|
113
115
|
* @returns {VideoUrlToDownloadResponse}
|
|
114
116
|
*/
|
|
115
|
-
async uploadVideo (mp4Filename, { userEmails = [], name, desc, gameStartEpoch } = {}) {
|
|
117
|
+
async uploadVideo (mp4Filename, { userEmails = [], name, desc, gameStartEpoch, facility, court } = {}) {
|
|
116
118
|
const pieces = mp4Filename.split('.')
|
|
117
119
|
const ext = pieces[pieces.length - 1]
|
|
118
|
-
const makeVIDResp = await this.__callAPI('make_video_id', { userEmails, name, desc, gameStartEpoch, fileExt: ext })
|
|
120
|
+
const makeVIDResp = await this.__callAPI('make_video_id', { userEmails, name, desc, gameStartEpoch, facility, court, fileExt: ext })
|
|
119
121
|
const { hasCredits, vid } = JSON.parse(makeVIDResp)
|
|
120
122
|
if (hasCredits === false) {
|
|
121
123
|
return { hasCredits }
|