Quick hack moviematerial/youtube material, working buuut….

Software: Away3D 4.x

Mr Margaret Scratcher, Sr. Member
Posted: 15 September 2011 11:54 PM   Total Posts: 344   [ # 16 ]

Hmmmm gone through the first page of a google search and it’s not looking good…

   

Avatar
Darcey, Moderator
Posted: 15 September 2011 11:58 PM   Total Posts: 209   [ # 17 ]

Nope, I done the same, ended up trying a bytearray of a loader to another loader (hack from 2009).. Seems to have been closed up… But it was for loading an image from another server and bitmap data drawing that….

   

Mr Margaret Scratcher, Sr. Member
Posted: 16 September 2011 12:05 AM   Total Posts: 344   [ # 18 ]
Darcey - 15 September 2011 11:58 PM

Nope, I done the same, ended up trying a bytearray of a loader to another loader (hack from 2009).. Seems to have been closed up… But it was for loading an image from another server and bitmap data drawing that….


Gah… Very annoying… It’s like someone said, what sense does it make to have this security in place to stop protected content being copied from a swf on traceable server, but yet anyone sat at home will find no difficulties?

 

 

   

Avatar
Darcey, Moderator
Posted: 16 September 2011 12:07 AM   Total Posts: 209   [ # 19 ]

Check out the youtube api’s, there should be something in there that will allow you to do this. Custom video players etc, you see loads of them about playing youtube content, question is can bitmap data draw work in that :\

   

Mr Margaret Scratcher, Sr. Member
Posted: 16 September 2011 12:09 AM   Total Posts: 344   [ # 20 ]

Hmmmm:


http://ahmednuaman.com/blog/2009/09/08/using-the-youtube-player-in-3d/#more-385

 

   

Mr Margaret Scratcher, Sr. Member
Posted: 16 September 2011 12:10 AM   Total Posts: 344   [ # 21 ]
Mr Margaret Scratcher - 16 September 2011 12:09 AM

Hmmmm:


http://ahmednuaman.com/blog/2009/09/08/using-the-youtube-player-in-3d/#more-385

Forget that, it’s just using the native 3d from flashplayer 10…

   

Avatar
Darcey, Moderator
Posted: 16 September 2011 12:13 AM   Total Posts: 209   [ # 22 ]

doh!

   

Avatar
Choons, Sr. Member
Posted: 16 September 2011 12:28 AM   Total Posts: 281   [ # 23 ]

I made this quite a while ago using the YouTube API

http://mashflix.com/studio/Studio.html

I think what you may be running into is what YouTube does to ensure that people can’t download their videos to disk. I tried forever to get a handle to their swf so I could use a video player of my own design instead of YouTube’s “chromeless” player. I’ve got a crossdomain file for this if you think it would help.

   

Mr Margaret Scratcher, Sr. Member
Posted: 16 September 2011 12:31 AM   Total Posts: 344   [ # 24 ]

jayc says

  marcfolio said
  I had a simialr error and had to add a whole bunch of security domains. Here’s my list. After I added them I could access the bitmap data.

  Security.allowDomain(“www.youtube.com”);
  Security.allowDomain(‘www.youtube.com’); 
  Security.allowDomain(‘youtube.com’); 
  Security.allowDomain(‘s.ytimg.com’); 
  Security.allowDomain(‘i.ytimg.com’);
  Security.allowDomain(‘s0.2mdn.net’);

  Of course my player doesn’t use “draw” so that might be a problem.

THANK YOU !, and thank you all!

-jayc

 

YESSSS!! ........ No.

(Unless I put them somewhere incorrect..)

Could some server side proxy type deal overcome this?

   

Avatar
Darcey, Moderator
Posted: 16 September 2011 12:36 AM   Total Posts: 209   [ # 25 ]

Yep, a developer account with them and setup api and id’s and script calls etc may solve this, not sure, never tried but I’m guessing it should exist, still not sure if bitmap data draw will be released though while external loading of files.

There are possibilities with a bit of server side programming. Code up something that strips out the flv path from the swf and downloads it to the server. This script could also be used to give the file path to the video from your swf. But would require a dedicated server and a bit of knowledge in VS.NET for windows servers or C for Linux. If you do go down this path, google up source forge for code samples. And check firefox addons code for some of it’s tools which may help.

   

Avatar
Darcey, Moderator
Posted: 16 September 2011 12:42 AM   Total Posts: 209   [ # 26 ]

May be a possibility with getting a stream forwarded with some tool, maybe red5? or again .net and php.

Code for duplicating video via bitmap data.draw - works locally…

package
{
 
// ------------------------------------------------------------------------------------------------------------------------------------------------
 
import flash.display.Bitmap;
 
import flash.display.BitmapData;
 
import flash.display.Loader;
 
import flash.display.LoaderInfo;
 
import flash.display.MovieClip;
 
import flash.display.Sprite;
 
import flash.display.StageAlign;
 
import flash.display.StageScaleMode;
 
import flash.events.Event;
 
import flash.geom.Rectangle;
 
import flash.net.URLRequest;
 
import flash.system.LoaderContext;
 
import flash.system.Security;
 
import flash.text.TextField;
 
import flash.text.TextFieldAutoSize;

 
// ------------------------------------------------------------------------------------------------------------------------------------------------
 
 
 // ------------------------------------------------------------------------------------------------------------------------------------------------
 
[SWF(frameRate="31")]
 
// ------------------------------------------------------------------------------------------------------------------------------------------------
 
public class Test extends Sprite
 {
  
// ------------------------------------------------------------------------------------------------------------------------------------------------
  //http://www.youtube.com/watch?v=fBp4iy6D9Os
  
  
private var VideoID:String "fBp4iy6D9Os";
  private var 
TVLoader:Loader;
  
// ------------------------------------------------------------------------------------------------------------------------------------------------
  
  
  // ------------------------------------------------------------------------------------------------------------------------------------------------
  
public function Test()
  
{
   stage
.align StageAlign.TOP_LEFT;
   
stage.scaleMode StageScaleMode.NO_SCALE;
   
   
Security.allowDomain'*' );
   
Security.allowDomain'www.youtube.com' );  
   
Security.allowDomain'youtube.com' );  
   
Security.allowDomain's.ytimg.com' );  
   
Security.allowDomain'i.ytimg.com' );
   
   
Security.allowDomain("www.youtube.com");
   
Security.allowDomain("www.youtube.com");  
   
Security.allowDomain("youtube.com");  
   
Security.allowDomain("s.ytimg.com");  
   
Security.allowDomain("i.ytimg.com"); 
   
Security.allowDomain("s0.2mdn.net");
   
   
//Security.allowDomain("http://s.ytimg.com");
   //Security.allowInsecureDomain("*");
   //Security.allowDomain("*")
   
trace ("loading TV Video")
   
TVLoader = new Loader();
   
   
//bmp = new Bitmap(bmpData);
   
   
var loaderContext:LoaderContext = new LoaderContext();
   
loaderContext.checkPolicyFile true;
   
TVLoader.contentLoaderInfo.addEventListener(Event.INITloadTVTrailerCompletefalse0true);
   
TVLoader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"), loaderContext);// Chromeless player
   //TVLoader.load(new URLRequest("http://www.youtube.com/v/" + VideoID + "?version=3")); //chrome player
  
}
  
// ------------------------------------------------------------------------------------------------------------------------------------------------
  
  
  
private var youTubeVideoObject:Object;
  
  
  
// ------------------------------------------------------------------------------------------------------------------------------------------------
  
private function loadTVTrailerComplete(e:Event):void 
  {
   addChild
(TVLoader);
   
   
//trace(TVLoader.content);
   
   
var txt:TextField = new TextField();
   
txt.autoSize TextFieldAutoSize.LEFT;
   
txt.text TVLoader.content.toString();
   
txt.5;
   
txt.300;
   
addChild(txt);
   
   
youTubeVideoObject TVLoader.content;
   
youTubeVideoObject.addEventListener("onReady"youTubeVideoObjectReadyHandler);
  
}
  
// ------------------------------------------------------------------------------------------------------------------------------------------------
  
  
  
  
  
  
  
private var bmp:Bitmap;
  private var 
bmpData:BitmapData;
  
  
// ------------------------------------------------------------------------------------------------------------------------------------------------
  
private function youTubeVideoObjectReadyHandler(e:Event):void
  {
   youTubeVideoObject
.setSize(240,120);
   
youTubeVideoObject.loadVideoById(VideoID0);
   
   
   
bmpData = new BitmapData(240,120);
   
   
// These are standard AS3 commands and methods which are blocked, so your going to have to hack this before you can pass the bitmap data to
   // Away3D
   
   
bmpData.draw(stage,null,null,null,new Rectangle(0,0,240,120),false);
   
   
bmp = new Bitmap(bmpData);
   
bmp.300;
   
addChild(bmp);
   
   
this.addEventListener(Event.ENTER_FRAME,update);
  
}
  
// ------------------------------------------------------------------------------------------------------------------------------------------------
  
  
  
  
  // ------------------------------------------------------------------------------------------------------------------------------------------------
  
private function update(e:Event):void
  {
   bmpData
.draw(stage,null,null,null,new Rectangle(0,0,240,120),false);
  
}
  
// ------------------------------------------------------------------------------------------------------------------------------------------------
  
  
  
  
  
  
 
}
   

Avatar
Choons, Sr. Member
Posted: 16 September 2011 12:43 AM   Total Posts: 281   [ # 27 ]

this is the content of my crossdomain file on mashflix

<cross-domain-policy><allow-access-from domain=”*” ><allow-access-from domain=“mashflix.com” secure=“false” ><allow-access-from domain=“mashflix.com” to-ports=“80,443” ><allow-access-from domain=”*.youtube.com” ><allow-access-from domain=“s.ytimg.com” ><allow-http-request-headers-from domain=“mashflix.com” headers=”*” ></cross-domain-policy>

server permission level is 644 for it and the app is at 755. give it a shot

   

Avatar
Darcey, Moderator
Posted: 16 September 2011 12:50 AM   Total Posts: 209   [ # 28 ]

Just tried it with the following cross domain policy

<cross-domain-policy>
 <
allow-access-from domain="*" >
 <
allow-access-from domain="mashflix.com" secure="false" >
 <
allow-access-from domain="mashflix.com" to-ports="80,443" >
 <
allow-access-from domain="*.youtube.com" >
 <
allow-access-from domain="s.ytimg.com" >
 
 <
allow-access-from domain="www.youtube.com" >
 <
allow-access-from domain="i.ytimg.com" >
 <
allow-access-from domain="s0.2mdn.net" >
 
 <
allow-http-request-headers-from domain="mashflix.com" headers="*" >
 <
allow-http-request-headers-from domain="allforthecode.co.uk" headers="*" >
</
cross-domain-policy

Same result…. Cheers Choons smile

Well that’s me done for 1 night…. I’m soo tired and code blind that I can’t get an swf to show in the application I’m working on lol, I knew I should have stuck with bulk loader over maxLoader lol…

The test URL I was working from to see error in debug player can be seen at:
http://www.allforthecode.co.uk/away3d/dev/youtube_bitmapdata/

Good luck with that Mr Margaret Scratcher, if you suss it out let us know.

D

   

Mr Margaret Scratcher, Sr. Member
Posted: 16 September 2011 12:55 AM   Total Posts: 344   [ # 29 ]
Choons - 16 September 2011 12:28 AM

I made this quite a while ago using the YouTube API

http://mashflix.com/studio/Studio.html

I think what you may be running into is what YouTube does to ensure that people can’t download their videos to disk. I tried forever to get a handle to their swf so I could use a video player of my own design instead of YouTube’s “chromeless” player. I’ve got a crossdomain file for this if you think it would help.

Well, I think (Unless your player is doing something that I am not getting) that I have got that far (ie playing a youtube video within flash) it is only when you try to write the bitmpa data that the problems crop up.


Oddly enough, it seems that even without a crossdomain.xml or any security allowances within flash, you can still play content fine..

   

Avatar
Choons, Sr. Member
Posted: 16 September 2011 12:59 AM   Total Posts: 281   [ # 30 ]

yeah YouTube has that data all covered up if your domain isn’t on THEIR cross-domain trusted list, which NOBODY is. I remember there was a way to get around the security issues with Java but I quit there smirk

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X