HARRISBURG, Pa. — Legislation approved by the Pennsylvania state Senate on Wednesday seeks to clear legal hurdles for police departments to expand their officers’ use of body cameras, and it gives departments the discretion to refuse public requests for copies of audio or video recordings by officers.

The bill, which passed 47-1 after brief comments on the Senate floor, would add Pennsylvania to a growing list of states that are setting statewide policy over the collection of audio and video by officers, including body cameras and dashboard cameras.

Perhaps the most controversial aspect is the bill’s treatment of public access.

It exempts recordings from requests under Pennsylvania’s open-records law, although a court could still order the release of a police recording. The bill also sets limits on requests. In particular, it provides a window of just 20 days after the incident in which to submit a request for a copy of an officer’s audio or video recording.

It is grounds for a denial if a police department or prosecutor’s office decides the recording could contain evidence in a criminal matter or the identity of a confidential informant or victim, and that it cannot safely protect that information by removing or obscuring it. It also prevents public access to recordings made inside a law enforcement facility, such as a police department.

A similar bill died in the House last year after the Senate passed it in the legislative session’s final days.

The sponsor, Judiciary Committee Chairman Stewart Greenleaf, R-Montgomery, said the measure would help promote the use of body cameras and transparency in incidents involving camera-wearing officers. Several Democrats who backed the measure for that reason also criticized some of its elements. Senate Minority Leader Jay Costa, D-Allegheny, said he hoped the House would change the bill to make the recordings more publicly accessible, including recordings inside law enforcement facilities.

The bill initially gave a window of 60 days for public requests, before senators changed it Tuesday to 20 days at the request of Gov. Tom Wolf’s office and the Pennsylvania State Police, Greenleaf’s office said.

Wolf’s office said he supports the use of body cameras to “promote transparency and increase public safety,” although he did not offer an endorsement.

“We will continue to monitor the bill as it moves through the legislative process,” Wolf’s office said in a brief statement.

House Majority Leader Dave Reed, R-Indiana, said his caucus had not had any in-depth discussions on the legislation, and that the first step would be left to the Judiciary Committee.

It is supported by the Pennsylvania Chiefs of Police Association and the Pennsylvania District Attorneys Association. But it is opposed by the American Civil Liberties Union, which said the bill would make it nearly impossible for the public to obtain video.

The use of body cameras is limited in Pennsylvania, with law enforcement organizations unable to name more than a few departments that use them. The state police do not use body cameras, while departments in Pennsylvania’s two largest cities, Philadelphia and Pittsburgh, use body cameras on a limited basis.

The bill aims to remove a couple legal hurdles that police departments have cited as potential problems.

It clarifies that officers can gather body camera footage inside a private residence while on duty, an effort to address concerns about violating the state’s surveillance law, and it makes clear that uniformed officers can legally record any conversation while using a state police-approved device in public.

The bill does not address when a police camera must be turned on and how long data must be stored before it is erased, although it tasks the Pennsylvania State Police with writing guidelines for the storage of the recordings.