@pbvision/partner-sdk 0.1.15 → 0.1.16
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/README.md +6 -4
- package/package.json +1 -1
- package/src/index.js +12 -5
package/README.md
CHANGED
|
@@ -359,10 +359,12 @@ in-app browser, where the app may not open. On a phone without the PB Vision
|
|
|
359
359
|
app, the link shows a page for installing it.
|
|
360
360
|
|
|
361
361
|
**Testing.** With the test server (`useProdServer: false`), links start with
|
|
362
|
-
`pbvision://record` instead of `https://pb.vision/record
|
|
363
|
-
Vision app opens them, so test on a phone with a
|
|
364
|
-
|
|
365
|
-
|
|
362
|
+
`pbvision://record` instead of `https://pb.vision/record` and end with
|
|
363
|
+
`env=test`. Any installed PB Vision app opens them, so test on a phone with a
|
|
364
|
+
development build of the app. Current App Store and Google Play versions check
|
|
365
|
+
the link before recording and say it needs the development build. Older
|
|
366
|
+
versions would record the game and upload it to production, where the test
|
|
367
|
+
video doesn't exist, so the recording would be lost.
|
|
366
368
|
|
|
367
369
|
### Video Editors and Viewers
|
|
368
370
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -288,10 +288,11 @@ export class PBVision {
|
|
|
288
288
|
* inside a webview, so that the phone can open the PB Vision app.
|
|
289
289
|
*
|
|
290
290
|
* With the test server (`useProdServer: false`), the link starts with
|
|
291
|
-
* `pbvision://record`. Any installed PB Vision app
|
|
292
|
-
* development build of the app
|
|
293
|
-
*
|
|
294
|
-
*
|
|
291
|
+
* `pbvision://record` and ends with `env=test`. Any installed PB Vision app
|
|
292
|
+
* opens it, so test with a development build of the app. Current App Store
|
|
293
|
+
* and Google Play versions check the link before recording and say it needs
|
|
294
|
+
* the development build; older versions would record the game and upload it
|
|
295
|
+
* to production, where the test video doesn't exist, so it would be lost.
|
|
295
296
|
*
|
|
296
297
|
* @param {RecordingLinkOptions} [options]
|
|
297
298
|
* @returns {RecordingLink}
|
|
@@ -319,9 +320,15 @@ export class PBVision {
|
|
|
319
320
|
if (!vid) {
|
|
320
321
|
throw new Error('PB Vision did not return a video ID for this recording link')
|
|
321
322
|
}
|
|
323
|
+
// env=test lets the app explain a test-server link it can't record,
|
|
324
|
+
// instead of recording a game whose video exists only on the test server
|
|
325
|
+
const params = { vid, uid, resolution, fps, mayChangeResolution, mayChangeFPS }
|
|
326
|
+
if (this.isDev) {
|
|
327
|
+
params.env = 'test'
|
|
328
|
+
}
|
|
322
329
|
// encodeURIComponent() rather than URLSearchParams, which writes a space
|
|
323
330
|
// as "+" and not every app reads that back as a space
|
|
324
|
-
const query = Object.entries(
|
|
331
|
+
const query = Object.entries(params)
|
|
325
332
|
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
|
|
326
333
|
.join('&')
|
|
327
334
|
return { vid, uid, url: `${this.recordUrl}?${query}` }
|