Skip to content

Commit e050eb3

Browse files
authored
Merge pull request #13 from apivideo/feat/example/custom_file_name
feat: Allow custom video name
2 parents 7704532 + a379764 commit e050eb3

10 files changed

+104
-149
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
dist

.npmignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ tslint.json
33
webpack.config.js
44
node_modules
55
test
6-
dist/test
6+
dist/test
7+
.github
8+
sample

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
All changes to this project will be documented in this file.
33

4+
## [1.0.7] - 2022-10-10
5+
- Allow the user to customize the recorded video's name
6+
47
## [1.0.6] - 2022-07-06
58
- Update dependancies
69
- Add origin headers

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@ Using delegated upload tokens for authentication is best options when uploading
138138
#### Common options
139139

140140

141-
| Option name | Mandatory | Type | Description |
142-
| ----------: | --------- | ------ | ----------------------------------------------------- |
143-
| apiHost | no | string | api.video host (default: ws.api.video) |
144-
| retries | no | number | number of retries when an API call fails (default: 5) |
141+
| Option name | Mandatory | Type | Description |
142+
| ----------: | --------- | ------ | ------------------------------------------------------------------- |
143+
| apiHost | no | string | api.video host (default: ws.api.video) |
144+
| retries | no | number | number of retries when an API call fails (default: 5) |
145+
| videoName | no | string | the name of your recorded video (overrides the default "file" name) |
145146

146147

147148
### Example

dist/index.js

-1
This file was deleted.

dist/src/index.d.ts

-27
This file was deleted.

dist/test/index.test.d.ts

-1
This file was deleted.

examples/index.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<div>
2828
<button id="start" disabled>start recording</button>
2929
<button id="stop" disabled>stop recording</button>
30+
<input type="text" id="VideoName" />
3031
</div>
3132
<div>
3233
<p>Video link: <span id="video-link"><i>will be displayed when the recording is finished</i></span></p>
@@ -53,8 +54,10 @@
5354
});
5455

5556
document.getElementById("start").addEventListener("click", () => {
57+
const videoName = document.getElementById("VideoName").value
5658
recorder = new ApiVideoMediaRecorder(stream, {
57-
uploadToken: "UPLOAD_TOKEN"
59+
uploadToken: "UPLOAD_TOKEN",
60+
videoName: videoName
5861
});
5962

6063
recorder.start();

package-lock.json

+85-112
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)