Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from Igogrek/master
Browse files Browse the repository at this point in the history
Added video-live event to wait for video load
  • Loading branch information
VinceG authored Jan 16, 2019
2 parents 0ceddd9 + 30f00f4 commit 434cf23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ npm run dev
| notsupported | error | emitted when the browser does not support this feature |
| cameras | cameras | emitted when a list of all cameras available is loaded |
| camera-change | deviceId | emitted when camera change occurs |
| video-live | stream | emitted when video is started |

### Methods

Expand Down
4 changes: 4 additions & 0 deletions src/webcam.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ export default {
// old broswers
this.source = window.HTMLMediaElement.srcObject(stream);
}
// Emit video start/live event
this.$refs.video.onloadedmetadata = () => {
this.$emit('video-live', stream);
};
this.$emit("started", stream);
},
Expand Down

0 comments on commit 434cf23

Please sign in to comment.