The emergency services were alerted in the early hours after a festival-goer reported the car alight.
Firefighters discovered Ryan's body in the remains of the burned out vehicle.
Buckley, 18, of Swan Close, Melton Mowbray, Leics, had previously denied manslaughter on July 7, 2013, but changed his plea to guilty moments before his trial in front of a jury was due to start.
Miss Dempster told the court: "Jack Buckley has pleaded guilty to manslaughter on the basis that he didn't know there was anybody in the car. That is accepted.
"He broke the car window to retrieve his property. The first time he went to retrieve a bag of cannabis and then he went back to the car.
"It was very dark and he used his lighter to illuminate the glove compartment. He dropped the lighter and thought it had gone out. It is accepted that the fire was not deliberately started. But once he realised the car was on fire he took no steps to put the fire out.
"The victim Ryan Morrell was one of his closest friends. Jack Buckley was unaware of the death of his friend until his arrest the following morning."
Judge Michael Heath adjourned sentence for reports and remanded Buckley in custody until later this month.
Detective Superintendent Matt Hewson of Leicestershire Police, who led the investigation said: "The evening started as a group of friends out together having fun, but had a devastating ending.
"The consequences in this horrific incident are that a person has lost his life.
"Two families have been torn apart by the events that night - not just the family of Ryan, who have to face life without him, but also the family of Buckley.
"I hope today's plea will go some way to helping Ryan's family to move forward and start to rebuild their lives."
At the time of his death Ryan's mum Nicola Morrell, paying tribute to her son, said: "Ryan's mates said he was fine at the festival, laughing and joking. The day before he died he gave me a hug and a kiss and said he loved me.
"Ryan was a happy lad and we used to have a laugh and a joke. He was also a real thrill-seeker who had no fear.
"Ryan died in the car, I just hope he was asleep and didn't suffer.
"I hope the person who did this realises they have ruined our lives as well as their own life."
- Daily Mail