Jump to content


Photo

TSmedia enigma2 plugin 1.0


  • This topic is locked This topic is locked
2611 replies to this topic

Re: TSmedia enigma2 plugin 1.0 #2501 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 17 September 2018 - 21:46

Hello @mfaraj57

 

Thank you for your remarks/notes.

 

 


Just tested with E2iPlayer and I was impressed by the design and the available keys,also movement between different keys is smooth as well as availablity of many languages not available in classical enigma keyboard.

i did not see google suggestion in action ,may be not implented yet in the last update.

 

The google suggestions functionality was not implemented yet.  I am under design this functionality...

 

 

 


1- shortcuts for frequent  key usage like insert space,clearall,move marker to right or left or end or begining,

I'll think about that. Generally in the next update when you keep pressed red or OK button the repeat will work, so when you keep pressed red button it will clear all the text.
Left and right arrows to move cursor inside text will work when you go to the text field, but I will also add this functionality to the fast-forward/backward buttons.
Space can assigned to the stop or play button. I am not sure which one will be better?
 

 


2- Assignment colors to main actions as in classical enigma keyboard(because user used to use them) ,green for enter,yellow for langauage

Green is assigned to the enter. In the standard Enigma2 Virtual Keyboard the yellow button change a language to the next one. With this virtual keyboard it does not make much sense. The list of languages is to long.

From other hand short cut for special key like AltGr is need to be able to effective write with other then english language.

 

 


3-sms typing.

Yes, I know this will be added.

 

 


4-need some work with full hd skin and hd skin(the keyboard located down in the tv screen with hd skin and small with full hd skin)

 

I like the location on the down on the screen. In most system with Virtual Keyboard it is located at the down of the screen, but this can be changed very easy. To do this only one value need to be changed.

The current skin was preapred for HD ready 1080x720, this is skin which I am using and you are right with Full HD screen it is too small.

 

Best Regards,

SSS


Edited by samsamsam, 17 September 2018 - 21:47.


Re: TSmedia enigma2 plugin 1.0 #2502 littlesat

  • PLi® Core member
  • 57,187 posts

+699
Excellent

Posted 18 September 2018 - 12:03

@SSS,

 

Where is your keyboards code?


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: TSmedia enigma2 plugin 1.0 #2503 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 18 September 2018 - 17:32

Hello,

 

It could be find in the E2iPlayer repository:

https://gitlab.com/i...onents/e2ivk.py

 

It is not finished yet. 
I am still working on it. 
There is many thing to improve.
Please treat it like proof of concept.
 
I could also provide source code of KLC file parser written in python if you are interested.
 
Regards,
SSS


Re: TSmedia enigma2 plugin 1.0 #2504 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 18 September 2018 - 19:12

Most of us use two languages,one English and the other is the local one,so your are right to assign yellow rc button to the only installed and not list all languages.
I know with other systems the keyboard usually in the bottom but that for reason that the keyboard displayed on top of parent screen while on enigma it displayed alone unless you have plan to make it appears as dialog but do not think it is applicable.,however it does not mattar it is just change the y position of the screen.
My request to make your virtualkeyboard as standalone module and not dependent on any library or functions from E2iPlayer as may be good replacement for the current virtualkeyboard and to be able to include it with our built images.

Re: TSmedia enigma2 plugin 1.0 #2505 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 19 September 2018 - 21:25

Hello @mfaraj57

 


My request to make your virtualkeyboard as standalone module and not dependent on any library or functions from E2iPlayer as may be good replacement for the current virtualkeyboard and to be able to include it with our built images. 

 

It should be possible without big effort but at first I must finish its implementation. 

In the version of "2018.09.19.01" I added possibile to set the own suggestions provider with folowing interface:

 
class SuggestionsProviderSkeleton:
    def __init(self):
        self.stamp = -1
 
    def getProviderName(self):
        return "Example Suggestions Provider Name"
 
    def start(self, callback):
        self.callback = callback
 
    def stop(self):
        # do nothing
        self.callback = None
 
    def term(self):
        # called at exit from the VK
        pass
 
    def set(self, txt, locale):
        self.stamp += 1
        # call asynchronous function to get suggestions for txt
        return self.stamp
 
    def _callback(self, data):
        if self.callback:
            self.callback(['example suggestion 1', 'example suggestion 2'], self.stamp)
 
self.session.openWithCallback(self.enterPatternCallBack, E2iVirtualKeyBoard, title=(_("Your search entry")), text = "start text", additionalParams={'autocomplete':SuggestionsProviderSkeleton()})

 

So, twisted web module can be used to implement this interface.

 

However, as I mentioned in the E2iPlayer I do not use twisted modute, so I implement SuggestionsProvider using python threading and enigma2 eTimer to poll suggestions (to not touch graphic components from other then main thread):

https://gitlab.com/i...vksuggestion.py

 

In the E2iPlayer at now I only wrote and use "Youtube Suggestions" provider in the Youtube host:

 

thumb_2928578VK_Suggestions.png



Re: TSmedia enigma2 plugin 1.0 #2506 aouamed

  • Senior Member
  • 45 posts

0
Neutral

Posted 19 September 2018 - 22:34

a keyboard that makes writing and searching a lot easier .... etc
thanks samsamsam



Re: TSmedia enigma2 plugin 1.0 #2507 Pr2

  • PLi® Contributor
  • 6,182 posts

+261
Excellent

Posted 20 September 2018 - 11:46

Very nice keyboard! Great job.


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: TSmedia enigma2 plugin 1.0 #2508 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 20 September 2018 - 12:27

@samsamsam

Well-done and Fantastic,impressive keyboard

suggestions are working great and smooth,shortcuts are working nicely and moving between keys and text field  and suggestions is smooth.

From technical point dmm always warns about using threads with enigma but i see you are using many threading classes in E2iPlayer efficiently and no unstable effect in performance .I could not follow the code of virtual keyboard in E2iPlayer but i see it is tied well to to other modules of E2iplayer so difficult to seperate at this time to use it elsewhere.

may be i wrong and may not profisional  but still see using history of search is useful and put it in place of languages and languages put with other shorcuts like menu .I know search history is available outside the keyboard screen but more practical and a lot easier to include in with the keyboard itself.

 

Great samsamsam.

 

 

Almamlaka_TV-2092018-1145.png


Edited by mfaraj57, 20 September 2018 - 12:29.


Re: TSmedia enigma2 plugin 1.0 #2509 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 20 September 2018 - 14:11

@mfaraj57

 


From technical point dmm always warns about using threads with enigm

 

Yes, I know the threads in python are not the best because of GIL (global interpreter lock) and also you should never access GUI elements from other python thread directly.

But if you know this, you can use them safely (with all GIL disadvantages of course).

 

In the E2iPlayer to receive data from server (download source code of web pages) PyCurl can be used. With PyCurl data are download without global interpreter lock taken. 

 

This topic is very large to discuss. Anyway when you want to execute I/O operation like downloading data from server, the python thread are still good choice to not block main thread for a long.

 


but i see it is tied well to to other modules of E2iplayer so difficult to seperate at this time to use it elsewhere.

 

Nope, these relation are really small and when I finish implementation of version for E2iPlayer then I can prepare version which will use only standard Enigma2 modules.

Of Course without functionality downloading keyboard languages definitions at real time.

 

Let's check the module by module:

 


from Plugins.Extensions.IPTVPlayer.components.cover import Cover3


Re: TSmedia enigma2 plugin 1.0 #2510 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 20 September 2018 - 14:14

Superb I wrote so long post and forum do not save it. Wonderful!!! Thanks OpenPli for wonderful forum script. What a shit!

This is not first time. I report problem with this that when you use [ quote ] [ quote ] tags sometimes only part of the post is saved



Re: TSmedia enigma2 plugin 1.0 #2511 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 20 September 2018 - 14:18

So, I must wrote this again... 

 

from Plugins.Extensions.IPTVPlayer.components.cover import Cover3

 

This is really simple extension of the Pixmap class:

 

class Cover3(Pixmap):
    def __init__(self):
        Pixmap.__init__(self)
        self.visible = True
 
    def setPixmap(self, ptr):
        self.instance.setPixmap(ptr)
        
    def getWidth(self):
        return self.instance.size().width()
 
    def getHeight(self):
        return self.instance.size().height()
        
    def setPosition(self, x, y):
        self.instance.move(ePoint(int(x), int(y)))
 
    def getPosition(self):
        p = self.instance.position()
        return (p.x(), p.y())


Re: TSmedia enigma2 plugin 1.0 #2512 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 20 September 2018 - 14:29

from Plugins.Extensions.IPTVPlayer.tools.iptvtools import printDBG, printExc, mkdirs, GetDefaultLang, GetIconDir, GetE2iPlayerVKLayoutDir, GetResourcesServerUri
from Plugins.Extensions.IPTVPlayer.components.e2isimpledownloader import SingleFileDownloaderWidget
printDBG, printExc - wrappers for print function, can be replaced by print or simple removed
mkdirs, GetDefaultLang, GetIconDir, GetE2iPlayerVKLayoutDir, GetResourcesServerUri, SingleFileDownloaderWidget - used to implement downloading VK language layouts files at runtime, so they will be not needed if this functionality will be removed

Edited by samsamsam, 20 September 2018 - 14:29.


Re: TSmedia enigma2 plugin 1.0 #2513 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 20 September 2018 - 14:30

from Plugins.Extensions.IPTVPlayer.components.iptvplayerinit import TranslateTXT as _
 
Used for E2iPlayer translation - can be safely removed. 
 
That's all. There are no more dependencies to the E2iPlayer modules.
 
As you can see E2iVirtualKeyboard can be simple modified to remove dependencies to the E2iPlayer modules. 
The only site effect will be removing functionality of download VK languages definitions at runtime. But list of available in the system language files could be pass as argument instead.
 
I can prepare E2iVirtualKeyboard as standalone module, but first I must finish  it implementation for the E2iPlayer.

Edited by samsamsam, 20 September 2018 - 14:30.


Re: TSmedia enigma2 plugin 1.0 #2514 samsamsam

  • Senior Member
  • 2,024 posts

+146
Excellent

Posted 20 September 2018 - 14:33

@mfaraj57

 

On your screen shot I see that your font does not have left/right arrows chars, they could be replaced by png graphics, but I afraid that your font is missing much more characters.


Edited by samsamsam, 20 September 2018 - 14:33.


Re: TSmedia enigma2 plugin 1.0 #2515 mick80

  • Senior Member
  • 254 posts

+6
Neutral

Posted 20 September 2018 - 22:14

Hey mfaraj57, I've noticed that items bookmarked to favorites now get a gray "favorites" thumbnail when launched from inside the favorite section. Is there any way to turn this off? I'd rather have the addon's main icon to be displayed just like it happens when launching the addon from inside the desktop. At the very least it'd be nice to have the option in settings to choose one or the other.

Re: TSmedia enigma2 plugin 1.0 #2516 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 September 2018 - 09:17

@samsamsam

 

 

Yes, I know the threads in python are not the best because of GIL (global interpreter lock) and also you should never access GUI elements from other python thread directly.

But if you know this, you can use them safely (with all GIL disadvantages of course).

 

Thanks for the info,i do not these details and nobody mentioned them when said threading with enigma is bad.

I am struggling with thread to execute host module to get data but when plalying the output streaming url i got abnormal behaviour.

(screen executing thread disappears -current dvb service appears for seconds-player) while without threading the transition between parent screen and player is smooth without appearance of current dvb service

as following picure show

all.jpg

 

Now my code similar to this but not my true code because it is more complicated to show

class Test(Screen):
	skin = """
		<screen position="0,0" size="1280,720" title="Test" >
			<widget name="text" position="250,100" size="250,400" font="Regular;26" />
			<widget name="list" position="250,250" size="190,250" scrollbarMode="showOnDemand" />
			<widget name="pixmap" position="200,0" size="190,250" />
                        <eLabel  position = "250,570"   zPosition = "4"   size = "200,25"  halign = "center"  font = "Regular;22"  transparent = "0" foregroundColor = "white" backgroundColor = "blue" text = "Play throgh thread" />
			<eLabel  position = "250,600"   zPosition = "4"   size = "200,25"  halign = "center"  font = "Regular;22"  transparent = "0" foregroundColor = "white" backgroundColor = "green" text = "play without thread" />

       


		</screen>"""
	def __init__(self, session, args = None):
		self.skin = Test.skin
		Screen.__init__(self, session)
		self.session=session
                
		self["list"] = MenuList(list)#FileList("/", matchingPattern = "^.*\.(png|avi|mp3|mpeg|ts)")
		self["pixmap"] = Pixmap()
		
		
                
                self["text"] = Label("press blue to start download and play file,red to exit")
                
		self["actions"] = ActionMap(["WizardActions", 'ColorActions'],
		{			
			"back": self.close,
                        "green": self.play_without_thread,
			"blue": self.play_with_thread,
		}, -1)
		
        def play_with_thread(self):
            
            
            self["text"].setText("Downloading stream...please wait...")
            url='http://tunisia-dreambox.info@tunisia-dreambox.info/download/test.mp4'
            localfile="/tmp/test.mp4"
            self.download_thread=threading.Thread(target=self.download, args=(url,localfile))
            self.download_thread.start()
            return
            
	def download(self,url,localfile):
                        
                        r = requests.get(url, timeout=15,verify=False)
                        self["text"].setText("Writing data to /tmp/test.mp4...")
                        time.sleep(2)
                        
                        if r.status_code == 200:
                            with open(localfile, 'wb') as f:
                                f.write(r.content)
                            f.close()
                        self["text"].setText("Download finished...")    
                        self.playfile()    
            
        def playfile(self):
                self["text"].setText("Playing stream..."  )               
                localfile="/tmp/test.mp4"
                sref = eServiceReference(4097, 0, localfile)
                sref.setName("test-downloaded by thread")
                from Screens.InfoBar import MoviePlayer
                self.session.open(MoviePlayer, sref)            
        def play_without_thread(self):
                url='http://tunisia-dreambox.info@tunisia-dreambox.info/download/test.mp4'
                sref = eServiceReference(4097, 0, url)
                sref.setName("test-play without thread")
                from Screens.InfoBar import MoviePlayer
                self.session.open(MoviePlayer, sref)

may be  the cause of abnormal behaviour by using GUI component through the thread but still need solution.


Edited by mfaraj57, 21 September 2018 - 09:19.


Re: TSmedia enigma2 plugin 1.0 #2517 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 September 2018 - 09:29

@samsamsam

 

 

printDBG, printExc - wrappers for print function, can be replaced by print or simple removed

mkdirs, GetDefaultLang, GetIconDir, GetE2iPlayerVKLayoutDir, GetResourcesServerUri, SingleFileDownloaderWidget - used to implement downloading VK language layouts files at runtime, so they will be not needed if this functionality will be removed

I am familiar with these function printDBG,printExc and others  because i read E2iPlayer code frequently to see your resolving techniques for some sites and movies hosts but got confused bu the lanaguge related functions.

but now it clear.

thanks



Re: TSmedia enigma2 plugin 1.0 #2518 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 September 2018 - 09:37

@samsamsam

 

In the E2iPlayer to receive data from server (download source code of web pages) PyCurl can be used. With PyCurl data are download without global interpreter lock taken. 

 

Yes,i know Pycurl but never used it as said it is faster than requests and urllib but using external library with enigma still have some limitation,i do not know if curl library included with default eniigma python package or no but mostly no.

however i do not have problem with using curl because there is library for kodi script.module.pycurl and i can use it easily with TSmedia

https://github.com/a...t.module.pycurl

last time i read the code of your E2iPlayer i noticed you are using urllib2 in getpage funciton or class but not pycurl.



Re: TSmedia enigma2 plugin 1.0 #2519 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 September 2018 - 09:41

@samsamsam

 

 

 

On your screen shot I see that your font does not have left/right arrows chars, they could be replaced by png graphics, but I afraid that your font is missing much more characters.

I do not know but the language in the my screenshot language chosen by mistake for estonia,however it is default regular font of openatv image for xtrend7500



Re: TSmedia enigma2 plugin 1.0 #2520 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 September 2018 - 09:55

Hey mfaraj57, I've noticed that items bookmarked to favorites now get a gray "favorites" thumbnail when launched from inside the favorite section. Is there any way to turn this off? I'd rather have the addon's main icon to be displayed just like it happens when launching the addon from inside the desktop. At the very least it'd be nice to have the option in settings to choose one or the other.

Usually the image of the added item stored within the favorites.xml  so should be displayed as screenshot down shows,but sometimes the item image is not available so the icon of the addon is displayed if installed if not installed the favorites icon displayed

However i have to check that because no problem with this in my system

 

fav.jpg


Edited by mfaraj57, 21 September 2018 - 09:56.



3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users