📜 ⬆️ ⬇️

YouTube videos in your Flash / Flex site

Recently made a site with a very cut budget for Flex-e. There was a problem with the placement of video content (saving $ on hosting, and hosting 2 g of video ...), having suffered from FXVideo Comp and SWFLoader, hit search in Google.

The solution was found:
TubeLoc - (YouTube LocalConnection) is the bridge between your swf app and the YouTube video player (which is written in AS2).
I liked the component, figured it out in 10 minutes. There are examples for clean AS3 projects as well as for Flex. :)
Of the chips - embedding the usual YouTube player, and chromeless.


')
Everything would be fine if it were not for videos of erotic content and cutting from the concert of Merlin Manson, issued by the player at the end. The reason is the original name of the file type title01.flv. Although the tags were given as "Children's songs, Children's music, Children, etc.".
Of course I tried to change everything, but so far it did not really help.

The solution was found in the YouTube blog:

If you’d like to add a video to your video player, simply add it to your embed code.

For TubeLoc on line 215 in MovieSprite.as

concatenatedUrl = playerWrapperUrl + [...] + escape(apiUrl);

on

concatenatedUrl = playerWrapperUrl + [...] + escape(apiUrl + "&rel=0");

And of course you can add from this list (it was found on the noname, alas, I could not find the author, in any case, a big respect for him :))

1. How to watch YouTube videos in high quality

On YouTube, there is a huge amount of video clips and even in such a quality that it’s not a sin to stretch the player to full screen, in order to check if there is a better quality video, add '& fmt = 18 ′ (stereo, 480 x 270 resolution), '& fmt = 6 ′ (mono, 480 x 270 resolution) or' & fmt = 22 ′ (stereo, 1280 x 720 resolution).
18: Bitrate 512, 24 fps, H.264 video codec, AAC audio codec
6: 900 bitrate, 30 fps, Flash Sorensor video codec, MP3 audio codec

2. How to insert a clip from YouTube to a site with good quality

So we figured out how to watch videos in good quality, but it’s not a sin to show such a miracle, for this we add to the embeded code either “& ap =% 2526fmt% 3D18 ″ or“ & ap =% 2526fmt% 3D22 ″ respectively.

3. How to insert a link to YouTube video for a specific minute (second)

Sometimes the rush itself begins after 5 minutes of delirium, and spends time on all sorts of nonsense, oh, I don’t want to. Therefore, in order to save the time of your friends, add to the link “# t = 03m22s” m - minutes, s - seconds.

4. How to hide the search box in YouTube

The damn search window is inconvenient, and in principle unnecessary - why we need it, don't we, let's remove it - '& showsearch = 0 ′

5. How to insert only a piece of video from YouTube

Sometimes it is just necessary, so we simply substitute the link '& start = 30 ′ and the video starts from 30 seconds.

6. How to automatically play videos in embeded from YouTube

Tortle users, make them watch the video constantly with every boot and reboot - with the help of '& autoplay = 1 ′

7. Automatically repeat video from YouTube

And here everything is simple, the postscript to the address of the clip '& loop = 1 ′ will help.

8. Remove related videos

Again, everything is just '& rel = 0 ′

9. Disable regional restriction (currently not working - a92)

It happens and this, in order to disable this ban - change the address of the video from www.youtube.com/watch?v = <some code> to www.youtube.com/v <some code>

10. How to download videos from YouTube?

Yes, just change youtube.com to kickyoutube.com and download for health

Source: https://habr.com/ru/post/72134/


All Articles