An It Gets Better video made by students at the Mormon Brigham Young University in Utah did not violate the school’s honour code, an official has said.

Carri Jenkins, an assistant to the president of BYU, told CNN the code is “based on conduct, not on feeling, and if same-gender attraction is only stated, that is not an honor code issue.”

The honour code at the private university, which counts presidential hopeful Mitt Romney among its alumni, forbids gay intimacy on risk of suspension.

It says: “Homosexual behavior is inappropriate and violates the honor code. Homosexual behavior includes not only sexual relations between members of the same sex, but all forms of physical intimacy that give expression to homosexual feelings.”

Straight students are subject to provisions in the honour code obliging them to live “chaste and virtuous” lives.

Twenty two students, however, spoke of their gay attraction or of being “straight allies” in the It Gets Better video last week.

The film estimates the LGBT community of the Utah university to be around 1800 students.

The video has been watched nearly 317,000 times on Youtube.

In 2006, a group of gay rights activists aiming to highlight religious gay discrimination was arrested after telling students that policies of the university’s owner, The Church of Jesus Christ of Latter-day Saints, were killing gays.

Carri Jenkins told the Associated Press then: “We had made it very clear that visitors were welcome on campus with restrictions, but could not use campus as a public forum.”

“They knew that they were in violation.”

A part time philosophy lecturer’s contract was not renewed that year after he said opposing marriage equality and seeking a constitutional amendment to ban gay marriages, a move supported by alumnus Mitt Romney, was “immoral”.