Main Contents

Playing YouTube videos continuously in your flash application

Although YouTube (Google Code) provides fantastic APIs for developing your own YouTube-based applications, somehow a very simple API does not exist: detecting the end of video event.


I don't even know if YouTube videos dispatches the end-of-video event at all, but according to the discussions in the forum, it seems that it does not exist anyway. I have struggled with this problem for about a month or so.


At this moment, duration information in the meta-data of a video is the only solution (let me know if there is another way):


1. List video IDs that you want to play continuously
2. Play the first video and set a Timer object with its duration
3. When the Timer object reaches the time, it dispatches the "timer" event
4. Then the timer event handler call the function that plays the next video
5. Repeat 2-4 until the end of the list

... it is just simple, however, it took a month for me to reach this conclusion. Because of the confidentiality of the project, I cannot distribute the code, but perhaps someday I might write a pseudo-code for this in a paper.

Now I can get on to the next step!!!! Well, I have to finish off a paper for CHI2008: interactivity, though.


Comments

the VideoDisplay in Flex dispatches a VideoEvent (VideoEvent.COMPLETE) when the playhead reaches the end of an .flv file.

Post a comment

(research:log では不適切なコメントを防止するため、コメントを掲載する前に管理者がコメントの内容を確認しています。コメントを初めて投稿する場合すぐに掲載されませんが、管理者が適切なコメントと判断した場合コメントは直ちに表示されますので、再度コメントを投稿する必要はありません。)

コメントフォーム

Copyright © here.