我正在vLine上进行应用
我用声音互相视频聊天。
但是,它不响铃。
响铃铃声有什么特别之处吗?
此explanation看起来没有针对铃声的特殊设置。
var client, vlinesession;var lastMsg;
var vlineClient = (function(){
if('{{vlineData.serviceId}}' == 'YOUR_SERVICE_ID' || '{{vlineData.serviceId}}' == 'YOUR_SERVICE_ID'){
alert('Please make sure you have created a vLine service and that you have properly set the $serviceID and $apiSecret variables in classes/Vline.php file.');
}
var authToken = '{{ vlineData.authToken }}',
serviceId = '{{ vlineData.serviceId }}',
profile = {"displayName": '{{ vlineData.displayName }}', "id": '{{ vlineData.id }}'};
// Create vLine client
window.vlineClient = client_ = vline.Client.create({"serviceId": serviceId, "ui": true,
'uiVideoPanel':'showvideo'
});
// Add login event handler
client_.on('login', onLogin);
client_.login(serviceId, profile, authToken).done(this.init_,this);
// Do login
//
//
//
//
function initCallButton(button) {
var userId = button.attr('data-userid');
// fetch person object associated with username
vlinesession.getPerson(userId).done(function(person) {
// update button state with presence
function onPresenceChange() {
if(person.getPresenceState() == 'online'){
button.removeClass().addClass('active');
}else{
button.removeClass().addClass('disabled');
}
button.attr('data-presence', person.getPresenceState());
}
// set current presence
onPresenceChange();
// handle presence changes
person.on('change:presenceState', onPresenceChange);
// start a call when button is clicked
button.click(function() {
if (person.getId() == vlinesession.getLocalPersonId()) {
alert('You cannot call yourself. Login as another user in an incognito window');
return;
}
if(button.hasClass('active'))
// person.postMessage("Hello there");
// console.log("send message");
person.startMedia();
});
});
答案 0 :(得分:1)
客户端具有setRingtone功能,可让您设置单个文件 路径或路径数组,比如mp3和ogg文件格式。它得到了 从文档中删除。你可以设置你的铃声 创建客户端。我们将确保在下一次构建中导出文档。
/**
* Set the sound to be played as the ringtone for calls. The parameter takes an
* array of paths, so that you can pass in different file formats like
* ogg and mp3 for cross browser support.
* @param {!string|!Array.<!string>} audioFilePath path to audio file(s).
*/
setRingtone(<audioPath(s)>)