<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Programming Ideas, Logics, Tips and Tricks &#187; flv</title>
	<atom:link href="http://www.sajithmr.me/tag/flv/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sajithmr.me</link>
	<description></description>
	<lastBuildDate>Sat, 07 Apr 2012 16:30:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Embedded Flash Player is not working from another domain (Cross-Domain swf access )</title>
		<link>http://www.sajithmr.me/embedded-flash-player-flv-is-not-working-from-another-domain-cross-domain-swf-access</link>
		<comments>http://www.sajithmr.me/embedded-flash-player-flv-is-not-working-from-another-domain-cross-domain-swf-access#comments</comments>
		<pubDate>Fri, 18 Jul 2008 06:44:40 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[webworld]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[cross-domain]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[swf]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/embedded-flash-player-flv-is-not-working-from-another-domain-cross-domain-swf-access/</guid>
		<description><![CDATA[When I used an flv player for my website www.amvizone.com, the main problem I faced was the external embedding. So I provided the iframe embedddng method instead of embedded object like youtube. The problem was the embedded flash player only worked with the my domain (where the player.swf is placed). When I put the same [...]]]></description>
			<content:encoded><![CDATA[<p>When I used an flv player for my website <a href="http://www.amvizone.com" title="Amvizone - The Amateur Video Zone" target="_blank">www.amvizone.com</a>, the main problem I faced was the external embedding. So I provided the iframe embedddng method instead of embedded object like youtube. The problem was the embedded flash player only worked with the my domain (where the player.swf is  placed). When I put the same embedded code with src points to http://www.amvizone.com/player.swf  from another domain, the player did not work.</p>
<p><a href="http://www.amvizone.com" title="Amvizone - The Amateur Video Zone" target="_blank"><img src="http://www.sajithmr.com/wp-content/uploads/2008/07/flv.jpg" alt="FLV Player" /></a></p>
<p>Recently My Friend Rahul (He is the master in flash and action scripts)  gave me a solution for this. That is, you have to add cross-domain policy to your server to server the swf file to other domains.</p>
<blockquote><p>When a Flash document attempts to access data from another domain, Flash Player automatically attempts to load a policy file from that domain. If the domain of the Flash document that is attempting to access the data is included in the policy file, the data is automatically accessible.</p></blockquote>
<p>You have to create a file, crossdomain.xml and place in the root folder or any other folder where content is placed. The data in the crossdomain.xml file is shown below:</p><pre class="crayon-plain-tag"><code>&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&amp;lt;!-- http://www.foo.com/crossdomain.xml --&amp;gt;

&amp;lt;cross-domain-policy&amp;gt;

&amp;lt;allow-access-from domain=&quot;www.friendOfFoo.com&quot; /&amp;gt;

&amp;lt;allow-access-from domain=&quot;*.foo.com&quot; /&amp;gt;

&amp;lt;allow-access-from domain=&quot;105.216.0.40&quot; /&amp;gt;</code></pre><p></p><pre class="crayon-plain-tag"><code>&amp;lt;/cross-domain-policy&amp;gt;</code></pre><p>The above configuration allow any subdomains of foo.com or a particular ip 105.216.0.40 or  www.friendOfFoo.com</p>
<p>If you need to provide access to all domains , you can use the following xml:</p><pre class="crayon-plain-tag"><code>&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;

&amp;lt;!-- http://www.foo.com/crossdomain.xml --&amp;gt;

&amp;lt;cross-domain-policy&amp;gt;

  &amp;lt;allow-access-from domain=&quot;*&quot; /&amp;gt;

&amp;lt;/cross-domain-policy&amp;gt;</code></pre><p><p><p>
Courtesy:  Adobe.com</p>
<p>And special thanks to Rahul for sharing the information</p>
<p>For details: click <a href="http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;file=00001621.html" title="Adobe Policy" target="_blank">here </a></p>
<p>Regards</p>
<p>Sajith M.R</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/embedded-flash-player-flv-is-not-working-from-another-domain-cross-domain-swf-access/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Requirements for a Video Website</title>
		<link>http://www.sajithmr.me/requirements-for-a-video-website</link>
		<comments>http://www.sajithmr.me/requirements-for-a-video-website#comments</comments>
		<pubDate>Mon, 23 Jun 2008 07:52:57 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[webworld]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/requirements-for-a-video-website/</guid>
		<description><![CDATA[If you are planing to start a video website like youtube, here is some things to keep in mind. FLV PLAYER ======== You know in now a days most of the video streaming websites use flash player for video streaming. The video file is in flv format. So you need a flash video player for [...]]]></description>
			<content:encoded><![CDATA[<p>If you are planing to start a video website like youtube, here is some things to keep in mind.</p>
<p><img src="http://www.sajithmr.com/wp-content/uploads/2008/06/usher_love480.jpg" /></p>
<p>FLV PLAYER<br />
========</p>
<p>You know in now a days most of  the video streaming websites use flash player for video streaming. The video file is in flv format. So you need a flash video player for this purpose.<br />
You can download a free flash / flv player from : <a href="http://www.jeroenwijering.com/?item=JW_FLV_Player" target="_blank">http://www.jeroenwijering.com/?item=JW_FLV_Player</a><br />
or <a href="http://flowplayer.org/" target="_blank">http://flowplayer.org/</a></p>
<p>FORMAT CONVERSION<br />
===============</p>
<p>Now you need videos in flv file format. In normal cases, most of the videos uploaded by an user will be in avi, dat ,mpg,mp4 or 3gp. So you need a flv converter. You can use either <a href="http://www.sajithmr.com/ffmpeg-sample-code/" target="_blank">ffmpeg</a> library or <a href="http://www.sajithmr.com/mencoder-video-convertion-tool/" target="_blank">mencoder</a> for this purpose</p>
<p>Here is a sample video emmbedding method.</p>
<pre class="crayon-plain-tag"><code>&lt;object&gt;
codebase=&quot;http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0&quot;
width=&quot;450&quot; height=&quot;375&quot; id=&quot;/YouTube_video/youtube&quot; align=&quot;middle&quot;&gt;
&lt;param name=&quot;movie&quot; value=&quot;youtube.swf?xml=config.xml&amp;video=121264118224947.flv&quot;&gt;&lt;/param&gt;
&lt;param name=&quot;quality&quot; value=&quot;high&quot;&gt;&lt;/param&gt;
&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot;&gt;&lt;/param&gt;
&lt;embed src=&quot;youtube.swf?xml=config.xml&amp;video=121264118224947.flv&quot;&gt;&lt;/embed&gt;
bgcolor=&quot;#ffffff&quot; width=&quot;450&quot; height=&quot;375&quot; type=&quot;application/x-shockwave-flash&quot;
pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; /&gt;;
&lt;/object&gt;</code></pre><p>
Here src parameter points the swf file, the flash palyer and video parameter points the flv file. This is the format of player i used in <a href="http://www.amvizone.com" title="The Amateur Video Zone" target="_blank">http://www.amvizone.com</a></p>
<p>ffmpeg also can be used for making thumbnails and video watermarking</p>
<p>STORAGE and BANDWIDTH<br />
=====================</p>
<p>Where would you save flv files. In yourown server ? If there is a minimum number of videos, your server might handle it. But consider the case having a large number of videos, your server bandwidth will  get used  soon. So we have to switch into a CDN (Content Data Network) like <a href="http://www.sajithmr.com/amazon-s3-example/" target="_blank">amazone S3.</a> What you have to do is just register with any CDN website and use their webservices for uploading and manipulating your video files. These CDN have very reasonable cost for the bandwidth usage and storage space.</p>
<p>Comment here if any queries<br />
Regards</p>
<p>Sajith M.R</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/requirements-for-a-video-website/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Download Youtube Videos using PHP Code</title>
		<link>http://www.sajithmr.me/download-youtube-videos-using-php-code</link>
		<comments>http://www.sajithmr.me/download-youtube-videos-using-php-code#comments</comments>
		<pubDate>Thu, 29 May 2008 10:18:20 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[grabber]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/download-youtube-videos-using-php-code/</guid>
		<description><![CDATA[&#160; If you want to get the FLV file of any youtube video url using php code, here is the solution. If you are a PHP Programmer and if you are working with any video website, and if you need to grab videos (FLV files) from youtube and to put it yourown site (not object [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>If you want to get the FLV file of any youtube video url using <strong>php code</strong>, here is the solution.</p>
<blockquote><p>If you are a PHP Programmer and if you are working with any video website, and if you need to grab videos (FLV files) from youtube and to put it yourown site (not object embedding) , Download the Full Source Code given at the end of this article (ZIP)</p></blockquote>
<p>I used this php code for the <strong>Youtube video download</strong> tool <a href="http://www.googleneedle.com/" target="_blank">http://www.googleneedle.com</a></p><pre class="crayon-plain-tag"><code></code></pre><p>Here function getPatternFromUrl is nothing but, get the exact pattern of a particular video from any youtube video url format.</p>
<p>In the above case , it returns <strong>pzmP4UvZRa4</strong></p>
<p>The function is below</p><pre class="crayon-plain-tag"><code>function getPatternFromUrl($url)

 {

$url = $url.'&amp;amp;';

$pattern = '/v=(.+?)&amp;amp;+/';

preg_match($pattern, $url, $matches);

return ($matches[1]);

}</code></pre><p><p>
GetFlvFromYoutube is the main function here, which download the flv file from youtube pattern and saves to your local machine.<br />
The function is below:</p><pre class="crayon-plain-tag"><code>function GrabFlvFromYoutube( $pattern )
{

 require_once (&quot;phptube.php&quot;);

 $tube = new PHPTube ();

 $flv_http_path = $tube-&amp;gt;download($pattern) ;

 echo $flv_http_path;

 set_time_limit(0);

 $data = file_get_contents($flv_http_path);

 $new_flv_path = dirname(_FILE_).'/flvs/'.$pattern.'.flv' ;

 file_put_contents($new_flv_path, $data);

 return $new_flv_path ;

}</code></pre><p><p><p>
<span style="color: #008000;">Hey, the old script I wrote is not working as youtube constantly changing their way they serve the contents.</span></p>
<p><span style="color: #008000;">I updated googleneedle website with code from here: <a href="http://1chris.com/post/39/using-php-to-download-youtube-flvs/" target="_blank"><span style="color: #008000;">http://1chris.com/post/39/using-php-to-download-youtube-flvs/</span></a></span></p>
<p><span style="color: #008000;">It works now, thank you Chris</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/download-youtube-videos-using-php-code/feed</wfw:commentRss>
		<slash:comments>84</slash:comments>
		</item>
	</channel>
</rss>

