In Video-on-Demand(VOD) system, it is very important to allocate channels efficiently, so that the most people can view the video immediately, rather than leave the system because of long waiting time. In this paper, an algorithm based on dynamic programming is proposed to maximize the expectation of served users by combining broadcasting with batching. Furthermore, a recommended system is applied in this algorithm which utilizes the remaining buffer to increase the number of served users further. The simulation result shows that the algorithm works well.