Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ringtone fix #79

Merged
merged 3 commits into from Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 1 addition & 10 deletions resources/gcphone/fxmanifest.lua
Expand Up @@ -70,16 +70,7 @@ files {
'html/static/fonts/fontawesome-webfont.woff',
'html/static/fonts/fontawesome-webfont.woff2',

'html/static/sound/ring.ogg',
'html/static/sound/ring2.ogg',
'html/static/sound/bella_ciao.ogg',
'html/static/sound/casa_papel.ogg',
'html/static/sound/iphone11.ogg',
'html/static/sound/safaera.ogg',
'html/static/sound/tusa.ogg',
'html/static/sound/xtentacion.ogg',
'html/static/sound/tchatNotification.ogg',
'html/static/sound/Phone_Call_Sound_Effect.ogg',
'html/static/sound/*.ogg',

}

Expand Down
5 changes: 5 additions & 0 deletions src_htmlPhone/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src_htmlPhone/package.json
Expand Up @@ -12,6 +12,7 @@
},
"dependencies": {
"babel-preset-es2017": "^6.24.1",
"howler": "^2.2.0",
"node-sass": "^4.9.0",
"sass-loader": "^6.0.7",
"vue": "^2.5.16",
Expand Down
9 changes: 8 additions & 1 deletion src_htmlPhone/src/PhoneAPI.js
@@ -1,6 +1,7 @@
import store from '@/store'
import VoiceRTC from './VoiceRCT'
import Vue from 'vue'
import {Howl} from 'howler'

import emoji from './emoji.json'
const keyEmoji = Object.keys(emoji)
Expand Down Expand Up @@ -328,11 +329,17 @@ class PhoneAPI {
}

onplaySound ({ sound, volume = 1 }) {
var path = '/html/static/sound/' + sound
if (!sound) return
if (this.soundList[sound] !== undefined) {
this.soundList[sound].volume = volume
} else {
this.soundList[sound] = new Audio('/html/static/sound/' + sound)
this.soundList[sound] = new Howl({
src: path,
onend: function () {
console.log('Finished!')
}
})
this.soundList[sound].loop = true
this.soundList[sound].volume = volume
this.soundList[sound].play()
Expand Down