If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Playing media through Cloudflare fails: "The video did not start playing in time"

steffend_steffend_ Posts: 19Members, Plex Pass Plex Pass

I'm trying to proxy requests to my server through Cloudflare (HTTPS), as the direct peering from some locations to my server is very slow. This works fine with Plex Web, Plex for iOS and Plex for Android.
When using the PS4 Client (1.40), browsing the library works fine, but playing an item results in the error "There was a problem playing this item. The video did not start playing in time."

IPADDRESS - - [30/Apr/2018:23:23:52 +0200] "GET /video/:/transcode/universal/decision?hasMDE=1&path=%2Flibrary%2Fmetadata%2F1201&mediaIndex=0&partIndex=0&protocol=hls&fastSeek=1&directPlay=0&directStream=1&subtitleSize=100&audioBoost=100&location=wan&maxVideoBitrate=4000&videoQuality=100&videoResolution=1280x720&session=incnvx4jlzykqldxpqkkw9b7&subtitles=burn&Accept-Language=en&X-Plex-Session-Identifier=upgewak8nepe5wua1kzxpse4&X-Plex-Client-Profile-Extra=add-limitation%28scope%3DvideoCodec%26scopeName%3D%2A%26type%3DupperBound%26name%3Dvideo.bitrate%26value%3D4000%26replace%3Dtrue%29%2Badd-limitation%28scope%3DvideoCodec%26scopeName%3Dh264%26type%3DupperBound%26name%3Dvideo.level%26value%3D41%26replace%3Dtrue%29%2Badd-limitation%28scope%3DvideoCodec%26scopeName%3Dh264%26type%3DupperBound%26name%3Dvideo.level%26value%3D41%26replace%3Dtrue%29%2Badd-transcode-target-audio-codec%28type%3DvideoProfile%26context%3Dstreaming%26protocol%3Dhls%26audioCodec%3Dac3%26replace%3Dtrue%29%2Badd-limitation%28scope%3DvideoAudioCodec%26scopeName%3Dac3%26type%3DupperBound%26name%3Daudio.channels%26value%3D6%26replace%3Dtrue%29&X-Plex-Client-Identifier=pqk7fbesm2jedmmy52zsadxx&X-Plex-Device-Screen-Resolution=1280x720&X-Plex-Version=3.13.13&X-Plex-Product=Plex%20for%20PlayStation%204&X-Plex-Platform=WebMAF&X-Plex-Platform-Version=01.40&X-Plex-Device=PlayStation%204&X-Plex-Token=redacted&X-Plex-Client-Profile-Name=PlayStation%204%20App&X-Plex-No-Cache=15251234122961088 HTTP/1.1" 200 1177
IPADDRESS - - [30/Apr/2018:23:23:53 +0200] "GET /:/timeline?hasMDE=1&ratingKey=1201&key=%2Flibrary%2Fmetadata%2F1201&state=buffering&playQueueItemID=2187&time=1148064&duration=2957600&X-Plex-No-Cache=15251234325431101&X-Plex-Client-Identifier=pqk7fbesm2jedmmy52zsadxx&X-Plex-Device-Screen-Resolution=1280x720&X-Plex-Version=3.13.13&X-Plex-Product=Plex%20for%20PlayStation%204&X-Plex-Platform=WebMAF&X-Plex-Platform-Version=01.40&X-Plex-Device=PlayStation%204&X-Plex-Token=redacted&X-Plex-Session-Identifier=upgewak8nepe5wua1kzxpse4 HTTP/1.1" 200 160

The App never requests the start.m3u8 file, compared to when forcing the client to use http:

IPADDRESS - - [30/Apr/2018:22:31:49 +0200] "GET /video/:/transcode/universal/decision?hasMDE=1&path=%2Flibrary%2Fmetadata%2F1201&mediaIndex=0&partIndex=0&protocol=hls&fastSeek=1&directPlay=0&directStream=1&subtitleSize=100&audioBoost=100&location=wan&maxVideoBitrate=4000&videoQuality=100&videoResolution=1280x720&session=j927e4g77rpf1c2hveakldbj&subtitles=burn&Accept-Language=en&X-Plex-Session-Identifier=gk2z0m4ociwlz5lmti3iiniv&X-Plex-Client-Profile-Extra=add-limitation%28scope%3DvideoCodec%26scopeName%3D%2A%26type%3DupperBound%26name%3Dvideo.bitrate%26value%3D4000%26replace%3Dtrue%29%2Badd-limitation%28scope%3DvideoCodec%26scopeName%3Dh264%26type%3DupperBound%26name%3Dvideo.level%26value%3D41%26replace%3Dtrue%29%2Badd-limitation%28scope%3DvideoCodec%26scopeName%3Dh264%26type%3DupperBound%26name%3Dvideo.level%26value%3D41%26replace%3Dtrue%29%2Badd-transcode-target-audio-codec%28type%3DvideoProfile%26context%3Dstreaming%26protocol%3Dhls%26audioCodec%3Dac3%26replace%3Dtrue%29%2Badd-limitation%28scope%3DvideoAudioCodec%26scopeName%3Dac3%26type%3DupperBound%26name%3Daudio.channels%26value%3D6%26replace%3Dtrue%29&X-Plex-Client-Identifier=pqk7fbesm2jedmmy52zsadxx&X-Plex-Device-Screen-Resolution=1280x720&X-Plex-Version=3.13.13&X-Plex-Product=Plex%20for%20PlayStation%204&X-Plex-Platform=WebMAF&X-Plex-Platform-Version=01.40&X-Plex-Device=PlayStation%204&X-Plex-Token=redacted&X-Plex-Client-Profile-Name=PlayStation%204%20App&X-Plex-No-Cache=1525120306323914 HTTP/1.1" 200 1174
IPADDRESS - - [30/Apr/2018:22:31:50 +0200] "GET /video/:/transcode/universal/start.m3u8?hasMDE=1&path=%2Flibrary%2Fmetadata%2F1201&mediaIndex=0&partIndex=0&protocol=hls&fastSeek=1&directPlay=0&directStream=1&subtitleSize=100&audioBoost=100&location=wan&maxVideoBitrate=4000&videoQuality=100&videoResolution=1280x720&session=j927e4g77rpf1c2hveakldbj&subtitles=burn&Accept-Language=en&X-Plex-Session-Identifier=gk2z0m4ociwlz5lmti3iiniv&X-Plex-Client-Profile-Extra=add-limitation%28scope%3DvideoCodec%26scopeName%3D%2A%26type%3DupperBound%26name%3Dvideo.bitrate%26value%3D4000%26replace%3Dtrue%29%2Badd-limitation%28scope%3DvideoCodec%26scopeName%3Dh264%26type%3DupperBound%26name%3Dvideo.level%26value%3D41%26replace%3Dtrue%29%2Badd-limitation%28scope%3DvideoCodec%26scopeName%3Dh264%26type%3DupperBound%26name%3Dvideo.level%26value%3D41%26replace%3Dtrue%29%2Badd-transcode-target-audio-codec%28type%3DvideoProfile%26context%3Dstreaming%26protocol%3Dhls%26audioCodec%3Dac3%26replace%3Dtrue%29%2Badd-limitation%28scope%3DvideoAudioCodec%26scopeName%3Dac3%26type%3DupperBound%26name%3Daudio.channels%26value%3D6%26replace%3Dtrue%29&X-Plex-Client-Identifier=pqk7fbesm2jedmmy52zsadxx&X-Plex-Device-Screen-Resolution=1280x720&X-Plex-Version=3.13.13&X-Plex-Product=Plex%20for%20PlayStation%204&X-Plex-Platform=WebMAF&X-Plex-Platform-Version=01.40&X-Plex-Device=PlayStation%204&X-Plex-Token=redacted&X-Plex-Client-Profile-Name=PlayStation%204%20App HTTP/1.1" 200 157

You can reproduce this by disabling remote access to the server (make sure that you are not on the same network) and map the Plex port to a port Cloudflare supports (e.g. 8443), on Linux:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 8443 -j REDIRECT --to-port 32400

Create a DNS record in Cloudflare pointing to the Public IP of the Plex server and enable proxying.
Then add "https://foo.your-cloudflare-domain.com:8443" to the "Custom server access URLs" of your Plex server.

Answers

  • steffend_steffend_ Posts: 19Members, Plex Pass Plex Pass
    edited April 30

    There's also an issue on Github about this, when using nginx as a reverse proxy:
    https://github.com/toomuchio/plex-nginx-reverseproxy/issues/5

    This is mostly a bug in PS4's client. It sort of works if you enable port 80, and disable HSTS and other forms of automatic http->https redirects. However, it doesn't work with cloudflare (even if you disable those things on cloudflare). PS4 is able to see the server, and get the metadata, but it won't actually play anything.

    Report it to the Plex devs, if you need PS4 support you'll have to disable CF nothing I can really do to help fix this. Out of my control, sorry folks :(

  • steffend_steffend_ Posts: 19Members, Plex Pass Plex Pass

    I just realized that you don't even have to disable remote access. Even when the server is reachable on the default port 32400, specifying the Cloudflare URL in the "Custom server access URLs" will make the PS4 app fail to play anything.

  • cw101cw101 Posts: 4Members, Plex Pass Plex Pass

    Yeah. Running Cloudflare with Plex will cause the PS4 app to not play media content. The PS4 app is in a pretty dismal state at the moment overall. Not sure if just difficult to develop for or what but it's definitely unfortunate :/

Sign In or Register to comment.