Skip to content

Commit

Permalink
Merge pull request #6012 from nextcloud/backport/5966/stable22
Browse files Browse the repository at this point in the history
[stable22]  Initialize the wav encoder in the entry points instead of in the audiorecorder component
  • Loading branch information
nickvergessen committed Jul 15, 2021
2 parents 213a556 + c5fcb14 commit f8e815f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/App.vue
Expand Up @@ -66,6 +66,8 @@ import UploadEditor from './components/UploadEditor'
import SettingsDialog from './components/SettingsDialog/SettingsDialog'
import ConversationSettingsDialog from './components/ConversationSettings/ConversationSettingsDialog'
import '@nextcloud/dialogs/styles/toast.scss'
import { register } from 'extendable-media-recorder'
import { connect } from 'extendable-media-recorder-wav-encoder'
export default {
name: 'App',
Expand Down Expand Up @@ -325,7 +327,7 @@ export default {
}
},
mounted() {
async mounted() {
// see browserCheck mixin
this.checkBrowser()
// Check sidebar status in previous sessions
Expand All @@ -334,6 +336,8 @@ export default {
} else if (BrowserStorage.getItem('sidebarOpen') === 'true') {
this.$store.dispatch('showSidebar')
}
register(await connect())
},
methods: {
Expand Down
7 changes: 7 additions & 0 deletions src/FilesSidebarTabApp.vue
Expand Up @@ -66,6 +66,8 @@ import ChatView from './components/ChatView'
import sessionIssueHandler from './mixins/sessionIssueHandler'
import browserCheck from './mixins/browserCheck'
import '@nextcloud/dialogs/styles/toast.scss'
import { register } from 'extendable-media-recorder'
import { connect } from 'extendable-media-recorder-wav-encoder'
export default {
Expand Down Expand Up @@ -138,6 +140,11 @@ export default {
},
},
async mounted() {
// Initialise audiorecorder encoder
register(await connect())
},
created() {
// The fetchCurrentConversation event handler/callback is started and
// stopped from different FilesSidebarTabApp instances, so it needs to
Expand Down
7 changes: 7 additions & 0 deletions src/PublicShareAuthSidebar.vue
Expand Up @@ -47,6 +47,8 @@ import {
import { signalingKill } from './utils/webrtc/index'
import sessionIssueHandler from './mixins/sessionIssueHandler'
import talkHashCheck from './mixins/talkHashCheck'
import { register } from 'extendable-media-recorder'
import { connect } from 'extendable-media-recorder-wav-encoder'
export default {
Expand Down Expand Up @@ -97,6 +99,11 @@ export default {
},
},
async mounted() {
// Initialise audiorecorder encoder
register(await connect())
},
beforeMount() {
window.addEventListener('unload', () => {
console.info('Navigating away, leaving conversation')
Expand Down
7 changes: 7 additions & 0 deletions src/PublicShareSidebar.vue
Expand Up @@ -61,6 +61,8 @@ import isInCall from './mixins/isInCall'
import participant from './mixins/participant'
import talkHashCheck from './mixins/talkHashCheck'
import '@nextcloud/dialogs/styles/toast.scss'
import { register } from 'extendable-media-recorder'
import { connect } from 'extendable-media-recorder-wav-encoder'
export default {
Expand Down Expand Up @@ -131,6 +133,11 @@ export default {
})
},
async mounted() {
// Initialise audiorecorder encoder
await register(await connect())
},
methods: {
async joinConversation() {
Expand Down
Expand Up @@ -78,8 +78,7 @@ import Check from 'vue-material-design-icons/Check'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip'
import { mediaDevicesManager } from '../../../utils/webrtc/index'
import { showError } from '@nextcloud/dialogs'
import { MediaRecorder, register } from 'extendable-media-recorder'
import { connect } from 'extendable-media-recorder-wav-encoder'
import { MediaRecorder } from 'extendable-media-recorder'
export default {
name: 'AudioRecorder',
Expand Down Expand Up @@ -156,10 +155,6 @@ export default {
},
},
async mounted() {
await register(await connect())
},
beforeDestroy() {
this.killStreams()
},
Expand Down

0 comments on commit f8e815f

Please sign in to comment.