mnlipp / CoCy4Enigma2

A UPnP Renderer for Enigma2
3 stars 1 forks source link

Use Mediaplayer2 instead of service #9

Closed midozalouk closed 4 years ago

midozalouk commented 4 years ago

Hello sir Can you please help me to use mediaplayer2 instead of run it as service channel

Or just guide me to edit it?

Thanks sir for the great plugin

mnlipp commented 4 years ago

I don't see any relation to CoCyEnigma2 in this. If you need help managing your enigma2-system, please address yourself to the respective forums.

midozalouk commented 4 years ago

Hello sir I am asking about Streaming by the cocy plugin

midozalouk commented 4 years ago

When i cast to cocy It plays as a service And not by the enigma2 player

So I can't jump forward

Know the time or use subtitles

Thanks sir

mnlipp commented 4 years ago

Please make sure that you understand what a UPnP (media)renderer is. CoCyEnigma2 implements a UPnP renderer, nothing else. If you need something different, don't use CoCyEnigma2.

The enigma2 player does not implement a UPnP control point and therefore it is not suited to control playback by a UPnP renderer.

midozalouk commented 4 years ago

Thanks sir for your replay I got your point by saying it can't control playback

But the cocy upnp don't support Jump forward or using external subtitles?

mnlipp commented 4 years ago

But the cocy upnp don't support Jump forward or using external subtitles?

I'm not sure what you mean by jump forward. It does support positioning as specified by UPnP. It does not support external subtitles, whatever that is. From the specifications, I'm not sure if controlling subtitles is covered by UPnP at all. I've never seen this feature being offered by a UPnP controller UI.

midozalouk commented 4 years ago

I mean by jump forward I can skip to certain time The problem sir i guess that it don't display the actual time of the file played

So i can't jump forward or backward

mnlipp commented 4 years ago

The problem sir i guess that it don't display the actual time of the file played

Most likely a problem of the control point implementation that you use, see #1.

midozalouk commented 4 years ago

Hello sir I have switched to openpli and tried it I can now jump forward But there is no correct time displayed How can i fix that

mnlipp commented 4 years ago

As discussed in #1, you probably need another UPnP controller.

midozalouk commented 4 years ago

I am using all type of controller Bubbleupnp Web media caster

The problem is not in the controller sir

The timing on the receiver doesn't work

I can use the controller to control it with the correct timing

But not on the receiver sir

mnlipp commented 4 years ago

Works for me with Fritz!App Media

midozalouk commented 4 years ago

Sir i swear i have no problem in android app I mean in the receiver or the renderer The timing is not right there

I am clear enough ?

mnlipp commented 4 years ago

I have no idea what you mean.

midozalouk commented 4 years ago

Sorry for my bad English When i cast to Smart TV over upnp It plays the file with the ability to play , pause, jump forward (JF) and jump backward (JB) from both the upnp server on android and from the upnp renderer on the TV itself. And it asks for external subtitle which i can load from the server (android app).

But this is not the case with cocy ; 1- On openatv ; it only support pause and play from the receiver (but support JF and JBfrom the server "android" in addition to play and pause )

B-On openpli it supports play, pause, JF and JB from both the receiver and the server, but it doesn't support external subtitle.

So i am asking 1- What is going wrong in openatv with cocy so I can fix it to be able to do JF and JB?

2- How can i add request to external subtitle on cocy on both openpli and openatv so i can load 🎭 provided subtitle from server?

Thanks sir ♥️

mnlipp commented 4 years ago

When i cast to Smart TV over upnp

If this works, you should save yourself the trouble of using CoCyEnigma2 in the first place.

1- On openatv ; it only support pause and play from the receiver (but support JF and JBfrom the server "android" in addition to play and pause )

I cannot support openatv, I don't have it installed. My assumption has always been that the small number of enigma2 APIs that I use behave in the same way on all distributions. If this is not the case, you have to find someone who can debug the behavior on a box using your favorite flavor of enigma2. My box runs OpenPLi in "production", i.e. I use it on a daily basis and cannot flash another version of enigma2 for debugging.

2- How can i add request to external subtitle on cocy on both openpli and openatv so i can load performing_arts provided subtitle from server?

As I have mentioned before, the UPnP specifications don't specify how to handle external subtitles. If you have a renderer that supports it, great, use it. But it must be using some proprietary extension.

midozalouk commented 4 years ago

Thanks sir for your support ♥️

midozalouk commented 4 years ago

Hello sir i managed to make it use Mediaplayer2 instead of default service with the ability to control it from the cast app i ca play , pause , JF ad JB

you have to edit the following code

if "source" in changed:
            def _source():
                try:
                    print "[CoCy] Creating service reference for " + str(changed["source"])
                    self._service = eServiceReference(4097, 0, changed["source"])
                    self._seek_offset = 0
                    self.fire(log(logging.DEBUG, "Created service %s" 
                                  % changed["source"]), "logger")
                    if self._eom:
                        self._on_play()
                except Exception as e:
                    self.fire(log(logging.ERROR, \
                                  "Failed to set player service to %s: %s"
                                  % (changed["source"], type(e))), "logger")
            blockingCallOnMainThread(_source)

by the following : `

if "source" in changed:
                    from Plugins.Extensions.MediaPlayer2.plugin import MediaPlayer, MyPlayList
                    if isinstance(self.session.current_dialog, MediaPlayer):
                        mp = self.session.current_dialog
                    # start new mp
                    else:
                        # bail out if we don't want to open a new mp
                        mp = self.session.open(MediaPlayer)
                    #self.playerHandle = self.session.open(MediaPlayer)
                    #self.playerHandle = self.session.current_dialog
                    mp.playlist.addFile(eServiceReference(changed["source"]))
                    mp.playServiceRefEntry(eServiceReference(changed["source"]))
                    mp.playlist.updateList()
                    mp.switchToPlayList()

it works like charm except for hiccup as after i exit the mediaplayer the video also plays as a service

are there any help you do to me??!!

Thaks sir