My code still exists in the desktop source[1] but essentially what you need to do is convert an srt to vtt [2] file and start a local http server that will serve the VTT file [3] and point the Chromecast to that
Not Popcorn Time, but I've had great experience using Airflow (airflow.app) for streaming video to Chromecast. Among other things, it handles subtitles quite well.
Teach me your ways, sensei.