Best recommendation is encode your 4K media to a format that can direct play the content.
I run an i7 with 256gig ssd (9k Passmark) and 4K maxes out the CPU and buffers terribly.
I really do not think there is much you can do to get 4K to transcode yet.
BTW. Why do you have 4K media to play on an iPhone, or a Browser when that will transcode always???
Keep your 4K media where only your 4K devices can play them directly and maintain a 1080p or less copy for all other devices not 4K capable.