Cancel video download when viewing in embeded players

    Everyone is familiar with the situation when a launched YouTube video (or another video host) wants to be canceled if it was launched by mistake or further viewing is not interesting. There is currently no way to cancel the download through the player. Even if you stop the video, it will continue to load until the end.

    Until Youtube has fastened the “cancel download” button to the embeded player, site owners can take advantage of a little trick and implement such a button on their own.

    * We consider Youtube.com as an example, although the principle works for other services.

    Below is a working example, if you copy it to an HTML file, save and run - it will work.

    A small explanation: when adding a video to the site, you can use something like this [youtube] dMH0bHeiRNg [/ youtube]

    The script that parses the record should convert it to the form that is specified inside the "Automatically generated content" block, that is, we just take this template in the right places instead of the label (choose yourself) we insert the movie code, in our case “dMH0bHeiRNg”.

    In addition, wherever convenient for you, you need to declare the youtube_video_init () function on the site.

    The principle of operation is as follows - the user presses the Play button - the video starts to load. The user presses the “Cancel Download” button, while the contents of the block are overwritten by himself, the flash player acquires its original appearance, the download stops.

    You can develop a thought, and try to stop loading by managing only the properties of the page objects.

    Have a nice work.











    Cancel Download






    Also popular now: