api_profile_init ( void )
{
static api_hook_t ah[] = {
- { "profile/list", ACCESS_ADMIN, api_profile_list, NULL },
- { "profile/class", ACCESS_ADMIN, api_idnode_class, (void*)&profile_class },
- { "profile/builders", ACCESS_ADMIN, api_profile_builders, NULL },
- { "profile/create", ACCESS_ADMIN, api_profile_create, NULL },
+ { "profile/list", ACCESS_ANONYMOUS, api_profile_list, NULL },
+ { "profile/class", ACCESS_ADMIN, api_idnode_class, (void*)&profile_class },
+ { "profile/builders", ACCESS_ADMIN, api_profile_builders, NULL },
+ { "profile/create", ACCESS_ADMIN, api_profile_create, NULL },
{ NULL },
};
tvheadend.VideoPlayer = function(url) {
var videoPlayer = new tv.ui.VideoPlayer({
- params: {
- resolution: 384
- }
+ params: { }
});
var selectChannel = new Ext.form.ComboBox({
});
var sliderLabel = new Ext.form.Label();
- sliderLabel.setText("90%");
+ sliderLabel.setText('90%');
slider.addListener('change', function() {
videoPlayer.setVolume(slider.getValue());
sliderLabel.setText(videoPlayer.getVolume() + '%');
});
- var selectResolution = new Ext.form.ComboBox({
+ if (!tvheadend.profiles) {
+ tvheadend.profiles = tvheadend.idnode_get_enum({
+ url: 'api/profile/list',
+ event: 'profile',
+ });
+ }
+
+ var selectProfile = new Ext.form.ComboBox({
+ loadingText: 'Loading...',
width: 150,
- displayField: 'name',
- valueField: 'res',
- value: 384,
+ displayField: 'val',
mode: 'local',
editable: false,
triggerAction: 'all',
- emptyText: 'Select resolution...',
- store: new Ext.data.SimpleStore({
- fields: ['res', 'name'],
- id: 0,
- data: [
- ['288', '288p'],
- ['384', '384p'],
- ['480', '480p'],
- ['576', '576p']
- ]
- })
+ emptyText: 'Select profile...',
+ store: tvheadend.profiles,
});
- selectResolution.on('select', function(c, r) {
- videoPlayer.setResolution(r.data.res);
+ selectProfile.on('select', function(c, r) {
+ videoPlayer.setProfile(r.data.val);
if (videoPlayer.isIdle())
return;
}
},
'-',
- selectResolution,
+ selectProfile,
'-',
{
iconCls: 'control_volume',
profile: 'pass',
mimetype: 'video/MP2T'
},
+ webm: {
+ profile: 'webtv-vp8-vorbis-webm',
+ playlist: false,
+ mimetype: 'video/webm; codecs="vp8.0, vorbis"'
+ },
hls: {
profile: 'webtv-h264-aac-mpegts',
playlist: true,
playlist: false,
mimetype: 'video/x-matroska; codecs="avc1.42E01E, mp4a.40.2"'
},
- webm: {
- profile: 'webtv-vp8-vorbis-webm',
- mimetype: 'video/webm; codecs="vp8.0, vorbis"'
- }
};
return {
this.video.setSize(width, height);
},
- setResolution: function(res) {
- this.params.resolution = res;
+ setProfile: function(pro) {
+ this.params.profile = pro;
},
isIdle: function() {
var config = config || {}
var params = {}
- Ext.apply(params, this._getProfile(), this.params);
+ if (!this.params.profile)
+ Ext.apply(params, this._getProfile(), this.params);
+ else
+ Ext.apply(params, this.params);
Ext.apply(params, config);
this.video.hide();
}
});
-
tv.app = function() {
return {
init: function() {