e2openplugin-OpenWebif
e2openplugin-OpenWebif copied to clipboard
web.js file has hard-coded port 8001 ? why ?
https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/blob/205eb8c467d704e971b6ef51d6c5ea44d796a20f/plugin/public/webtv/webtv.js#L345
Hi.
I am solving one small problem on the OpenATV discussion forum - https://www.opena.tv/english-section/54726-transcoding-port-8001-a.html .
Shouldn't the port value 8001 be read from the "/etc/enigma2/settings" file (or read from the Enigma configuration) instead of a hard-coded port value ? Specifically, it is the config.OpenWebif.streamport configuration entry.
Only if the configuration item does not exist in the "settings" file, only then should the fixed value of port 8001 in that web.js source code be used.
Thx.
I've previously noticed a similiar issue with the hardcoded http:// in the OpenWebif codebase.
There is existing functionality in other js to read config data, eg. var plf = GetLSValue('pl','m3u');
Let me know if you want me to take a look at the js side of this.
Unfortunately I don't know JavaScript and C-language well in the Enigma platform. I only know the Python language in Enigma. Otherwise, I would edit it myself (as a new pull-request patch).
I don't know how best to work out the configuration of plugins in Enigma, using C-language or JavaScript. Opening a file directly and reading one configuration entry from it is probably silly (I mean the "/etc/enigma2/settings" file). OOP is probably used also in the case of C-language, as in the case of the Python language.
Webpage and plugin config screen-related changes are in #1210
/openwebif/plugin/controllers/ajax.py up to today used the code below...
the getMachineBuild() line was last updated 3 years ago which means it's well-overdue an update (preferably by using feature-detection instead of device name checking).
Furthermore, VXGplayer is no longer available
https://www.videoexpertsgroup.com/player_start/
and Google has deprecated the functionality that allows it to run
https://developer.chrome.com/docs/native-client/migration/
(removing the media_player.pexe file would cut 2.3MB of space from OpenWebif)
A while ago, I took a look into moving WebTV towards HTML5 video standard but had no feedback.
def P_webtv(self, request):
if config.OpenWebif.auth_for_streaming.value:
session = GetSession()
if session.GetAuth(request) is not None:
auth = ':'.join(session.GetAuth(request)) + "@"
else:
auth = '-sid:' + str(session.GetSID(request)) + "@"
else:
auth = ''
vxgenabled = False
if fileExists(getPublicPath("/vxg/media_player.pexe")):
vxgenabled = True
transcoding = TRANSCODING
transcoder_port = 0
if transcoding:
try:
transcoder_port = int(config.plugins.transcodingsetup.port.value)
if getMachineBuild() in ('inihdp', 'hd2400', 'et10000', 'et13000', 'sf5008', 'ew7356', 'formuler1tc', 'tiviaraplus', '8100s'):
transcoder_port = int(config.OpenWebif.streamport.value)
except Exception:
transcoder_port = 0
return {"transcoder_port": transcoder_port, "vxgenabled": vxgenabled, "auth": auth}
@wedebe: How exactly are the problems you describe related to the problem of hard-coded port number 8001 in the source code? 🤔