odoo17 音视频扩展

ODOO内置了音视频服务,同时也提供了与第三方平台Twilio的接口,用以实现音视频的扩展:

Twilio是美国一家云通讯公司,算是云通讯领域的巨头企业,与同行业的公司以销售&营销进行投资来促进业务增长不同,Twilio则以API为基础,在数年内有机地打造了一个专业和广泛的软件开发员社区。

odoo原生代码:

复制代码
def _get_ice_servers(self):
    """
    :return: List of dict, each of which representing a stun or turn server,
            formatted as expected by the specifications of RTCConfiguration.iceServers
    """
    if self.env['ir.config_parameter'].sudo().get_param('mail.use_twilio_rtc_servers'):
        (account_sid, auth_token) = get_twilio_credentials(self.env)
        if account_sid and auth_token:
            url = f'https://api.twilio.com/2010-04-01/Accounts/{account_sid}/Tokens.json'
            response = requests.post(url, auth=(account_sid, auth_token), timeout=60)
            if response.ok:
                response_content = response.json()
                if response_content:
                    return response_content['ice_servers']
    return self._get_local_ice_servers()

class MailIceServer(models.Model):
    _name = 'mail.ice.server'
    _description = 'ICE server'

    server_type = fields.Selection([('stun', 'stun:'), ('turn', 'turn:')], string='Type', required=True, default='stun')
    uri = fields.Char('URI', required=True)
    username = fields.Char()
    credential = fields.Char()

    def _get_local_ice_servers(self):
        """
        :return: List of up to 5 dict, each of which representing a stun or turn server
        """
        # firefox has a hard cap of 5 ice servers
        ice_servers = self.sudo().search([], limit=5)
        formatted_ice_servers = []
        for ice_server in ice_servers:
            formatted_ice_server = {
                'urls': '%s:%s' % (ice_server.server_type, ice_server.uri),
            }
            if ice_server.username:
                formatted_ice_server['username'] = ice_server.username
            if ice_server.credential:
                formatted_ice_server['credential'] = ice_server.credential
            formatted_ice_servers.append(formatted_ice_server)
        return formatted_ice_servers

可以看到ODOO通过用户名和密码及API调用Twilio的第三方服务(Twilio按账号收费的)。

ODOO也可以通过二次开发的方式与其他音视频平台对接,但要考虑其对于ODOO自身带来的服务压力。

相关推荐
眠りたいです6 小时前
Qt音频播放器项目实践:文件过滤、元数据提取与动态歌词显示实现
c++·qt·ui·音视频·媒体·qt5·mime
FreeDw资源库13 小时前
功能强大!开源免费的视频翻译、音视频转录工具
音视频·音视频翻译
早睡身体好~2 天前
【lubancat】鲁班猫4实现开机后自动播放视频
音视频·linux开发
小幽余生不加糖2 天前
电路方案分析(二十二)适用于音频应用的25-50W反激电源方案
人工智能·笔记·学习·音视频
胡耀超2 天前
DataOceanAI Dolphin(ffmpeg音频转化教程) 多语言(中国方言)语音识别系统部署与应用指南
python·深度学习·ffmpeg·音视频·语音识别·多模态·asr
shix .2 天前
bilibili视频总结
音视频
lovep12 天前
音频-文本对比学习:LARGE-SCALE CONTRASTIVE LANGUAGE-AUDIO PRETRAINING论文翻译和理解
音视频·glap·音频理解·音频对比学习·laion-audio·音频检索
codelancera3 天前
ffmpeg-调整视频分辨率
ffmpeg·音视频
天向上3 天前
手机端的音视频界面或者图片文档界面共享给大屏
智能手机·音视频·多平台·手机投屏·多屏互动
ECC&SM94 天前
Video_AVI_Packet(1)
笔记·音视频