Investigation leader Tero Haapala told The Associated Press that Pekka-Eric Auvinen was online about half an hour before the first shots were reported at a high school in southern Finland on Nov. 7.
"He was working on his various manifestos and the publicly presented videos that contained material on handling guns among other things," Haapala said.
One of the video clips, titled "Jokela High School Massacre," showed a picture of the school and two photos of Auvinen holding a handgun.
Another video clip showed Auvinen loading a clip into a handgun and firing several shots at an apple placed on the ground in a wooded area. He smiled and waved to the camera at the end of the clip.
"He did some editing on these (YouTube) files. They were put on the Internet about 30 minutes before" the shooting started, Haapala said.
Auvinen killed six students, a nurse and the principal on Wednesday in Tuusula, about 50 kilometers (30 miles) north of the Finnish capital, Helsinki. He then shot himself in the head, and died hours later at a hospital.
Police are going through files seized from Auvinen's computer and have requested information from the Internet provider to find out more about his Web contacts.
Among them was a U.S. teenager, Dillon Cossey, who acknowledged plotting a school attack near Philadelphia.
The two teens communicated online about the 1999 Columbine school massacre in Colorado and exchanged videos they found on the Internet, Cossey's attorney said Monday.
Haapala said an autopsy was conducted on Auvinen on Tuesday to find out whether he was under the influence of alcohol, drugs or medication when he carried out the shooting. Results were expected in two weeks, Haapala said.
Finnish newspaper Helsingin Sanomat, citing unnamed sources, reported Tuesday that doctors had issued Auvinen prescriptions of antidepressant drugs such as Prozac. Police declined to comment on the report.