Bug Eject function does not automatically stop playing before ejecting
#1
i don't really know if this is a bug or feature.

Like the title, if i play a movie from dvd or blu-ray and push the eject button the disc get ejected but kodi did not stop playing the disk.

So i think that the eject function should check if the disk is being played, if so than stop first and then eject.

My home dvd player from LG does this well and as far as i know all store bought players have this behavior?

It is not a very big deal and i understand that there are much more important fixes or new features to be made, but it is annoying to me.

I'm using kodi 16 but it is also in 17.6
Reply
#2
Which Eject button are you referring to? The physical button on the DVD player?
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#3
oh sorry if i wasn't clear enough.

i use the eject button on my mce remote, it is configured to use the EjectTray function from kodi.
Reply
#4
This is what i use to ejectTray: <o mod="ctrl,shift">EjectTray()</o>

Or is it possible to have 2 functions for one keyboard command?
Like this: <o mod="ctrl,shift">stopPlaying(), EjectTray()</o> (this is a example)
Reply
#5
I found this but it is old and i can't get it to work with kodi 17?
https://forum.kodi.tv/showthread.php?tid=125859
Reply
#6
you could use wineject great little program 
works flawlessly and its free
Reply
#7
@rew88 
Thanks for the suggestion but this is not what i ment. this is for external drives, mine is internal.

I have no problem with ejecting or close the drive with the mce remote. 
The point is that i can eject the drive while playing. This shouldn't be possible, it should stop first than eject.

Maybe i should configure the eject button in the videoplayer section of the user keyboard.xml to stop and in the global section to eject?
This way you can't eject while playing, only on the remote that is..
Reply
#8
Here is a update from what i have tried and it works for my needs:

I added this to the FullScreenVideo keyboard section of keyboard.xml
Quote:<o mod="ctrl,shift">RunScript("C:\Users\kodi\AppData\Roaming\Kodi\userdata\stop-eject.py")</o>
Then i made the file stop-eject.py and edited like this:
Quote:import xbmc

xbmc.executebuiltin("PlayerControl(Stop)")
xbmc.executebuiltin("EjectTray()")
The effect of this is dat the remote eject button is linked to ctrl,shift o keyboard shortcut in full screen video, and it will execute the file stop-eject.py. If you press this button during playback of a dvd or blu-ray it will stop playing and eject the disk.
One little side-effect is that if you press the button the video playback freezes for a few seconds but that is not a big deal.
If not in full screen video the global keyboard ctrl, shift o will eject the disk also:
Quote:<o mod="ctrl,shift">EjectTray()</o>
It works for me but others may have a better way to do this?

This is a little off topic but i used the same principle for a alternate quit function. It gracefully stop's kodi and start windows explorer. I needed this because i start windows without the explorer shell to faster boot.
Quote:Edit the dialogbuttonmenu.xml like this:

<label>$LOCALIZE[13012]</label>
      <onclick>System.Exec("C:\Users\kodi\AppData\Roaming\Kodi\userdata\quit.cmd")</onclick>
      <visible>System.ShowExitButton</visible>

The quit.cmd looks like this:

@echo off
start /b taskkill /IM kodi.exe >nul
@echo off
start /b C:\Windows\explorer.exe
exit
This is tested with kodi 17 on Windows 10 x64
Reply

Logout Mark Read Team Forum Stats Members Help
Eject function does not automatically stop playing before ejecting0