javascript - LG webOS 3.0 TV App 中的媒体 Luna 服务
问题描述
需要知道以下服务的作用。
luna://com.webos.media 服务(注意:Luna 服务文档中没有提供)
我正在寻找频道的字幕/音频中的语言更改。请指导我完成这个。
请参考以下示例。
webOS.service.request("luna://com.webos.media", {
method:"selectTrack",
parameters: { "type": "audio", "index": index, "mediaId": mediaId },
onSuccess: function (result) {
console.log("[succes] select audio track " + index);
},
onFailure: function (result) {
console.log( "[fail][" + result.errorCode + "] " + result.errorText );
}
});
请提及此 API 的其他可用方法。
解决方案
我们已经成功地使用这种方法在 LG WebOS 设备的字幕和音轨之间切换。
可以参考这个链接改进: https ://github.com/webosose/umediaserver/blob/master/src/server/uMediaserver.cpp
/**
@page com_webos_media com.webos.media
@{
@section com_webos_media_selectTrack selectTrack
Selects Track
@par Parameters
Name | Required | Type | Description
-----|--------|------|----------
mediaId | yes | String | media id assigned to this media.
type | yes | String | track type: video, audio and subtitle.
index | yes | Integer | track index to select.
@par Returns(Call)
Name | Required | Type | Description
-----|--------|------|----------
returnValue | yes | Boolean | true if successful, false otherwise.
errorCode | no | Integer | errorCode only if returnValue is false.
errorText | no | String | errorText only if returnValue is false.
mediaId | yes | String | media id assigned to this media.
推荐阅读
- r - 如何根据 R 中不同数据框中的列值从一个数据框中删除行?
- java - If else 条件结合 && 和 || 在一行语句中
- date - SSRS - 如何显示开始日期始终为星期六的滚动 6 个月?
- ionic-framework - 在浏览器中运行的 Ionic 3:应用程序在切换回 Safari 时导航到 root
- php - Doctrine 合并实体与单向 OneToMany 不清除数据库条目
- css - 如何保存 CSS 动画
- mongodb - Mongoose:原子 FindOne-Or-Insert(),如果找到不更新现有实例
- javascript - ES6 使用命名空间动态导入?
- jquery - 将 jQuery 函数分别应用于出现的元素
- python - 已经安装好,但还是不能导入