The invention provides an audio and video playing method and device for a web
client, and the method comprises the steps: obtaining a playing control parameter of a target video
point location, then obtaining an audio and
video output signal, judging whether the hardware configuration of a
machine where the web
client is located supports
video decoding hardware acceleration or not, and if yes, carrying out
video decoding. If yes,
hardware acceleration video decoding is carried out on the audio and
video output signals, otherwise, CPU soft decoding is carried out on the audio and
video output signals, and decoded audio and video output signals are obtained; whether the
CPU load of the web
client is larger than a preset threshold value or not is judged, if yes, rendering frame extraction is conducted on the decoded audio and video output
signal, and audio and video playing is achieved after a target audio and video output
signal is obtained. Through the design of detecting the hardware configuration of the
machine, the resources of the
machine are utilized to the maximum extent, and the decoding performance is improved. By means of
packet loss detection in the framing stage and the rendering stage, the blurred screen playing phenomenon is avoided to the maximum extent, and the performance of a web player is greatly improved.