Search code examples
c#.netwinformsaxshockwaveflash

Need an event to be raised when shockwave flash object finishes


I am writing a pet project for my friends and I. This project consists of a client | server application.

The goal of this application is for my friends (using the client) to be able to paste a YouTube video URL and add it to a queue of other URLs.

The server will manage the list of URLs and stream them to each client.

I need an event to be raised on the server when the video finishes so I can start the next video in the queue.

This may not even be possible, but any ideas or advice are much appreciated. Thanks.

EDIT* Keep in mind that this is not ASP.NET.

I need to make an event in C# that is raised when the YouTube API event onStateChange is fired and get the number of the state. (0 = video ended)

I am trying to do this with axShockwaveFlash. I have also tried using a web browser control.

I have not tried using SWFObject yet, but i will be moving on to that next.

I know i am supposed to append &enablejsapi=1&playerapiid=ytplayer to my video URL to enable this API.

I have never used JavaScript before this. So if someone could show me an example of this it would be much appreciated.


Solution

  • If you have the source to the videoplayer, you can perform a javascript event when it is complete. See this url: http://blog.codefidelity.com/?p=15

    EDIT: Since it's the youtube video player, perhaps they have documentation on doing the same thing.

    EDIT2: Check out http://code.google.com/apis/youtube/js_api_reference.html, specifically "Subscribing to Events"