A man caught pleasuring himself in his van was parked right outside his mother-in-law's house and on a porn site logged into her wi-fi, a court heard.
Trevor Hollins was using his partner's mobile phone after he had just dropped her off at hospital.
He was seen masturbating by a witness, who couldn't believe what he was seeing and was so "disturbed" by it, he took pictures, called police and showed them the footage.
Hollins, who later told police he had been "feeling horny," and wanted some excitement, struck in the middle of the day in the driver's seat of the van, on a public road in a built-up, residential area, Burnley magistrates were told.
The 37-year-old, of Waterbarn Street, Burnley, admitted outraging public decency, in June. He will be sentenced at the end of October, after a pre-sentence report has been prepared and was warned by the bench chairman: "We are leaving all options open in this matter."
Miss Charlotte Crane (prosecuting) said Hollins had dropped his partner off at Burnley General Hospital. The offence was not sexually motivated.
Hollins wanted to use his partner's mobile phone to look at some adult sites on the internet.
The prosecutor added: "He decided to park directly outside his mother-in-law's address so he could log into her internet. He then used his partner's mobile phone to access an adult site. He engaged in some form of communication with people on that site, which resulted in him masturbating while using the mobile phone."
She told the hearing: "The defendant was interviewed and said he was looking for some form of excitement and thought he would take the opportunity while waiting to collect his partner from hospital. "
Miss Crane added: "It is the first recorded matter of this particular nature on his record."
Mr Daniel Frazer (defending) said Hollins was "lightly convicted." There were no sentencing guidelines for the offence.
The solicitor told the court: "It would cross the community threshold, if not into custodial territory."