KODi – pass a modified file source parameter to external player?

Greetings,

I’ve been struggling for more than half-an-year to achieve comfort in watching videos via KODi on a Philips NON-ROOTED Android TV (Lollipop 5.1) with pass-through multi-channel audio (AC3, DTS).
Not successful, of course.
Therefore,
I started looking for a workaround solution by using an external (for KODi) player – the “embedded” in the Philips TV media player, which is ugly, but it appears that it’s the only one for me, which does the trick with the pass-through to the AV receiver.
Following the available guidelines, I have pin-pointed the app for the “embedded” media player and set the playercorefactory.xml config for KODi.
However,
when the video source from KODi is passed to the external “embedded” media player – crash occurs every time.

According to the Android logcats from the TV, while making play attempt iterations,
I’ve determined the following differences:

  • when a video source is played from a file/media browser in the “embedded” media player:

    Quote:I/ActivityManager( 843): START u0 {act=android.intent.action.VIEW dat=file:///storage/emulated/legacy/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov typ=video/quicktime flg=0x10000000 cmp=org.droidtv.contentexplorer/.player.ExternalMediaPlaybackActivity} from uid 10094 on display 0

  • when the same video source is loaded from KODi in the “embedded” media player:

    Quote:I/ActivityManager( 843): START u0 {act=android.intent.action.VIEW dat=/storage/sdcard/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov typ=video/* pkg=org.droidtv.contentexplorer cmp=org.droidtv.contentexplorer/.player.ExternalMediaPlaybackActivity} from uid 10095 on display 0

My conclusion is that the “embedded” player cannot cope with the URL/URI parameter for the file source, which KODi is passing to it.
KODi log excerpt, IMHO, relevant to this is:

Quote:08:23:16.820 T:18446744072492805944 NOTICE: ExternalPlayer Filename: org.droidtv.contentexplorer
08:23:16.820 T:18446744072492805944 NOTICE: ExternalPlayer Tweaks: hideconsole (true), hidexbmc (true), islauncher (false), warpcursor ()
08:23:16.821 T:18446744072492805944 NOTICE: OpenFile: /storage/sdcard/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov
08:23:16.821 T:18446744072545548304 DEBUG: Thread ExternalPlayer start, auto delete: false
08:23:16.824 T:18446744072545548304 NOTICE: Process: Player : org.droidtv.contentexplorer
08:23:16.824 T:18446744072545548304 NOTICE: Process: File : /storage/sdcard/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov
08:23:16.824 T:18446744072545548304 NOTICE: Process: Content:
08:23:16.824 T:18446744072492805944 DEBUG: PlayFile: OpenFile succeed, play state 1
08:23:16.824 T:18446744072545548304 NOTICE: Process: Args : “file://”{1}
08:23:16.825 T:18446744072545548304 NOTICE: Process: Start
08:23:16.825 T:18446744072545548304 NOTICE: Process: Hiding Kodi window
08:23:16.826 T:18446744072492805944 DEBUG: Keyboard: scancode: 0x17, sym: 0x000d, unicode: 0x0000, modifier: 0x0
08:23:16.840 T:18446744072495384928 DEBUG: Draining Audio
08:23:16.842 T:18446744072492805944 DEBUG: Percentage is 0.000000
08:23:16.891 T:18446744072545548304 DEBUG: Previous line repeats 1 times.
08:23:16.891 T:18446744072545548304 DEBUG: OnPlayBackStarted: play state was 1, starting 0
08:23:16.920 T:18446744072492805944 DEBUG: Percentage is 0.000000
08:23:16.949 T:18446744072510305504 DEBUG: Previous line repeats 1 times.
08:23:16.952 T:18446744072510305504 DEBUG: JSONRPC: Incoming request: {“jsonrpc”: “2.0”, “method”: “Player.GetActivePlayers”, “id”: 1}
08:23:16.956 T:18446744072510305504 DEBUG: JSONRPC: Incoming request: {“jsonrpc”: “2.0”, “params”: {“playerid”: 1, “properties”: [“title”]}, “method”: “Player.GetItem”, “id”: 1}
08:23:17.019 T:18446744072545548304 NOTICE: ExecuteAppAndroid: org.droidtv.contentexplorer
08:23:17.020 T:18446744072510305504 DEBUG: GetMovieId (/storage/sdcard/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov), query = select idMovie from movie where idFile=1369
08:23:17.024 T:18446744072510305504 DEBUG: GetEpisodeId (/storage/sdcard/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov), query = select idEpisode from episode where idFile=1369
08:23:17.038 T:18446744072510305504 DEBUG: GetMusicVideoId (/storage/sdcard/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov), query = select idMVideo from musicvideo where idFile=1369
08:23:17.041 T:18446744072492805944 DEBUG: Percentage is 0.000000
08:23:17.099 T:18446744072492818592 DEBUG: Previous line repeats 2 times.
08:23:17.100 T:18446744072492818592 DEBUG: GetMovieId (/storage/sdcard/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov), query = select idMovie from movie where idFile=1369
08:23:17.104 T:18446744072492818592 DEBUG: GetEpisodeId (/storage/sdcard/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov), query = select idEpisode from episode where idFile=1369
08:23:17.110 T:18446744072492818592 DEBUG: GetMusicVideoId (/storage/sdcard/Download/Video/the-lego-ninjago-movie-trailer-1_h1080p.mov), query = select idMVideo from musicvideo where idFile=1369
08:23:17.120 T:18446744072492818592 DEBUG: CAnnouncementManager – Announcement: OnPlay from xbmc
08:23:17.121 T:18446744072492818592 DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPlay
08:23:17.189 T:18446744072492805944 DEBUG: Percentage is 0.000000

Played with the arguments in the playercorefactory.xml, but obviously my coding skills are little to none:

Code:
<playercorefactory>
        <players>
                <player name="Media" type="ExternalPlayer" audio="true" video="true">
                    <filename>org.droidtv.contentexplorer</filename>
                    <args>"-d file://"{1}</args>
                    <hidexbmc>true</hidexbmc>
                    <hideconsole>true</hideconsole>
                    <playcountminimumtime>120</playcountminimumtime>
                </player>
        </players>
        <rules action="prepend">
                <rule protocols="smb" player="CHOOSE PLAYER NAME HERE" />
                <rule dvdimage="true" player="CHOOSE PLAYER NAME HERE"/>
                <rule protocols="rtmp" player="CHOOSE PLAYER NAME HERE"/>
                <rule protocols="rtsp" player="CHOOSE PLAYER NAME HERE" />
                <rule protocols="sop" player="CHOOSE PLAYER NAME HERE" />
                <rule internetstream="true" player="CHOOSE PLAYER NAME HERE" />
                <rule video="true" player="Media"/> <!-- Default for anything else not listed -->
        </rules>
</playercorefactory>

So,
any hints and ideas how to form the “proper” URL/URI parameter, which the “embedded” player could load?

Thank you in advance for your opinions,
apologies for duplicating any already existing discussion on the matter.