Stop song after x minutes from Google Play Music

From Louis Lefebvre on 2017/01/09 00:09:28 +0000

Hello, is there any possibility to stop Google play music after minutes. Like Spotify in the lullaby menu on the sleep tracking phase if I am not wrong. Thus it would avoid to keep listening to music when you sleep already.

In case there is no official API available for GPM, what about an unofficial one or maybe there is a function in android that stop any multimedia ?

Copied from original feature request: