The sentence Es ist ihm sehr langweilig uses what I call the point-of-view dative. (This site uses the same term but for Latin.) The es here is an impersonal pronoun and in this case it stands for conditions in general; it's the same role played by "it" in "It's cold." The ihm says that the statement is only true according to "his" point of view. Literally, it says "It is, to him, very boring." Apparently boredom, to German speakers, is a quality of the environment and not individual people. German flexible word order allows you to move ihm in front of the verb, so you can rephrase the sentence as Ihm ist es sehr langweilig. The es is really just a placeholder, and since it's no longer need for V2 word order, it can be dropped, giving Ihm ist sehr langweilig. (The impersonal es is very prone to being left out, but in some situations more than others. So both versions are correct, but I think the second one is more idiomatic German.
I believe Der Film war mir sehr langweilig is grammatically correct, but there are alternatives. There is a verb langweilen you can use if something is boring someone. This is grammatically different from the adjective langweilig. So Der Film langweilte mich is possible, but I think the participle, Der Film hat mich gelangweilt, would be a more common phrasing. The English "I was bored by the film" is technically in the passive voice, so rendering it literally into German you'd get, Ich wurde von dem Film gelangweilt. But I think a somewhat looser translation would work better: Ich fand den Film langweilig./"I found the movie boring."