You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, May 1st 2012, 2:10pm

load a youtube video

Hi everybody,

I am trying to load a YouTube video into the tour.

Is it possible and how?

Thanks much

Frank

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

2

Tuesday, May 1st 2012, 2:35pm

There are ways to get the url of the video file (.flv) but it violates the terms of youtube. Imagine a website that indexes all those videos, stealing their bandwidth ;)

But Im not sure if youtube has a crossdomain.xml. Without that you would run into security sandbox errors.
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

HansNyb

Professional

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

3

Tuesday, May 1st 2012, 3:22pm

There are ways to get the url of the video file (.flv) but it violates the terms of youtube. Imagine a website that indexes all those videos, stealing their bandwidth ;)

But Im not sure if youtube has a crossdomain.xml. Without that you would run into security sandbox errors.


Much of the idea with youtube is that you embed the videos on your site, Thats why they have a special Embed link to generate what you need.
This is something most news sites in the world do. Also large official sites like the Danish Radio do it all the time.

I have not investigated in what the legal terms say for embedding it inside a flash panorama. I doubt they have anything which describes that.

But it has of course to be embedded in a frame which you can load the youtube site from.

Hans

Tuur

Sage

Posts: 3,113

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Tuesday, May 1st 2012, 3:29pm

copy embedcode and paste in notepad, get url of video , download, put in tour..

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

5

Tuesday, May 1st 2012, 3:35pm

Yes thats true. They allow it through their own embedding code. That code generates a player (with play, rewind, mute etc), links to youtube, commercial (income for them), and links to similar videos.

But krpano doesnt have a youtube player, but a videoplayer. That videoplayer requires a direct url to the source (a flv, mp4 etc). Youtube provides a somewhat encoded url, with some tricks you can find the true url to the flv. But you can imagine that youtube doesnt support or allow for this. All references of youtube would be removed, no links to youtube and no commercials showing. So it would cost youtube only money with nothing in return. You're basicly using youtube for free hosting ;)

But basicly it's this:
http://www.abdulqabiz.com/blog/archives/…er-side-script/

you have a youtube url like:
http://www.youtube.com/watch?v=V3BsjxDZJM0

And you rewrite it to:
http://www.youtube.com/v/V3BsjxDZJM0

and put that url in the videoplayer. *love*
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

HansNyb

Professional

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

6

Tuesday, May 1st 2012, 3:46pm

But krpano doesnt have a youtube player, but a videoplayer.


I was just hoping that an experienced coder like you would take the challenge and make one.

The hack- when Tommy can do it for FPP it must be an easy task for you.

http://wirestam.com/panos/Flash/youtube/youtest1.html

Hans

Posts: 1,850

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

7

Tuesday, May 1st 2012, 5:19pm

I thought this was already there.. Just set the video to the youtube link and done.
Only thing that won't work are distorted hotspots because of the crossdomain limitations.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

8

Tuesday, May 1st 2012, 5:38pm

Hi,

right, the youtube flash videoplayer can be already loaded directly into krpano - just use the url of the video as plugin or hotspot url!

But to improve the look and optimize the styling I would recommend using additional parameters for the youtube player like version=3 and controls=0...

e.g. something like that:

Source code

1
2
3
4
5
6
<plugin name="youtube"
    	url="http://www.youtube.com/v/7pyXV9lv3nY?version=3&amp;autoplay=1&amp;autohide=1&amp;controls=0&amp;loop=0&amp;modestbranding=0&amp;rel=0&amp;showinfo=0"
    	align="center"
    	maskchildren="true"
    	onloaded="registercontentsize(640,390);"
    	/>


For all parameters for the youtube player please see here:
https://developers.google.com/youtube/player_parameters

Look especially for the autoplay and loop parameters to control the playing of the video itself.


Some additional krpano settings can be used too to make the youtube player better usable:
  1. Use onloaded="registercontentsize(640,390);" to set the correct source size of the youtube player, 640x390 is the correct size for the version=3 player. Without version=3 parameter use 480x360 as size. Note - the size itself inside krpano can be freely defined and changed by the normal krpano width/height/scale settings.
  2. Use maskchildren="true" to hide the informations from youtube that were normally 'scrolling-out' of the view.
  3. If you don't want to let the user interact with the youtube player controls use children="false".

Here simple example:
http://krpano.com/examples/youtube/

And here the xml of it:
http://krpano.com/examples/youtube/youtube.xml

The youtube player can be used as <plugin> and as <hotspot> but not as distorted hotspot - youtube prohibits the video bitmap access, but that kind of access would be necessary for distorted hotspots.

Best regards,
Klaus

9

Thursday, May 17th 2012, 6:05am

You Tube as the 360 video pano?

Any way to play YouTube videos in the Video player plugin as the 360 panorama?

10

Friday, May 18th 2012, 1:02pm

Hi,
Any way to play YouTube videos in the Video player plugin as the 360 panorama?
No, that's not possible for 'security reasons' - YouTube doesn't allow pixel/bitmap access to the video, but that would be required to be able to distorted/transform the video to a pano!

I think that restriction should prevent the capturing/copying of the YouTube videos via Flash apps.

Best regards,
Klaus

mstoss

Intermediate

Posts: 280

Location: Berlin

  • Send private message

11

Wednesday, August 1st 2012, 6:51pm

Quite nice option! I tried and it works just fine. However, Is there a way to stop the youtube video as well? In my case it is a child to a background pane with close button. Closing the background parent plugin does not stop the video playing obviously, adding removeplugin does not stop the sound, the video seems to be gone though.

Source code

1
onclick="close-pane(ui-youtube_blank);removeplugin(youtube-video);"


In the youtube parameter list I see a start parameter, but no stop parameter (and I wouldn't know how to set that parameter BTW). I tried

Source code

1
set(plugin[youtube-video].start,0);


Any help appreciated very much,

Michael

12

Tuesday, August 21st 2012, 6:47pm



The youtube player can be used as and as but not as distorted hotspot - youtube prohibits the video bitmap access, but that kind of access would be necessary for distorted hotspots.

</plugin></plugin>
Hello Klaus</plugin></plugin>
in this link youtube player can be distorted </plugin></plugin>http://1.s3.envato.com/files/15254400/preview2.html
can you look at this sample please.
best regards.

13

Wednesday, August 29th 2012, 9:47am

Hi,
in this link youtube player can be distorted </plugin></plugin>http://1.s3.envato.com/files/15254400/preview2.html
can you look at this sample please.
there the video is distorted by the newer Flashplayer 10 internal DisplayObject rotation settings,

krpano doesn't used them because the core engine is still Flashplayer 9 compatible, and because these settings are slower and more inaccurate then 'directly doing the 3D stuff' and these simple rotation setting doesn't allow an usage in combination with any kind of fisheye distortion because withe them only 3d rotations are possible but no other '3d manipulation'...

but I think I could add optional support for that... let's see...

Best regards,
Klaus

Posts: 1,850

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

14

Monday, September 17th 2012, 11:38pm

Just verifying, that youtube videos, do not appear to work with the videoplayer plugin in any way.

Yes thats true. They allow it through their own embedding code. That code generates a player (with play, rewind, mute etc), links to youtube, commercial (income for them), and links to similar videos.

But krpano doesnt have a youtube player, but a videoplayer. That videoplayer requires a direct url to the source (a flv, mp4 etc). Youtube provides a somewhat encoded url, with some tricks you can find the true url to the flv. But you can imagine that youtube doesnt support or allow for this. All references of youtube would be removed, no links to youtube and no commercials showing. So it would cost youtube only money with nothing in return. You're basicly using youtube for free hosting ;)

But basicly it's this:
http://www.abdulqabiz.com/blog/archives/…er-side-script/

you have a youtube url like:
http://www.youtube.com/watch?v=V3BsjxDZJM0

And you rewrite it to:
http://www.youtube.com/v/V3BsjxDZJM0

and put that url in the videoplayer. *love*
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

15

Tuesday, September 18th 2012, 12:10am

Hi,


Here simple example:
http://krpano.com/examples/youtube/

And here the xml of it:
http://krpano.com/examples/youtube/youtube.xml

The youtube player can be used as <plugin> and as <hotspot> but not as distorted hotspot - youtube prohibits the video bitmap access, but that kind of access would be necessary for distorted hotspots.

Best regards,
Klaus


Hi Klaus your youtube link don't work on Safari *blink* but on Chrome it's ok

HansNyb

Professional

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

16

Tuesday, September 18th 2012, 9:10am

Works fine in my Safari.


Hans

17

Wednesday, September 19th 2012, 4:44pm

Hi,

that examples embeds the Youtube Flash viewer application, that means that example works only in Flash,
maybe your Safari is showing the HTML5 version... ?

Best regards,
Klaus

HansNyb

Professional

Posts: 936

Location: Denmark

Occupation: Photographer

  • Send private message

18

Tuesday, September 25th 2012, 10:28am

Hi,

that examples embeds the Youtube Flash viewer application, that means that example works only in Flash,
maybe your Safari is showing the HTML5 version... ?

Best regards,
Klaus


No it is Flash in Safari Desktop.
But as you say I may see the HTML5 version I do have a question on that.
Should it not be possible to also receive automatically the Youtube HTML5 version if you use iPad or HTML5 on desktop?

I am currently doing a large tour for a client who wants to use videos and he also have some on Youtube.
I have no problem getting them linked from both Bingmaps and the pano but I only get Flash.

Hans

mstoss

Intermediate

Posts: 280

Location: Berlin

  • Send private message

19

Wednesday, July 24th 2013, 2:05pm

Hello,

I desperately need some help with presenting some youtube videos in a tour. I reduced the code ever more and still could not make it work. In the end, I used the nearly pure code which Klaus provided a while ago (it had worked for me before). Obviously it still does at the krpano website. But when I try to use it on my server with another youtube video url, it doesn't.

Source code

1
2
3
4
5
6
<krpano>
	<plugin name="mask" devices="flash" keep="true" preload="true" url="skin/b_closevideo.png" blendmode="multiply" width="100%" height="100%" enabled="false" zorder="0"/>
	<preview type="grid(cube,16,16,512,0xCCCCCC,0xFFFFFF,0x999999);" details="16"/>
<plugin name="youtube" url="https://www.youtube.com/watch?v=ZXQlMgiPd8k?version=3&autoplay=1&autohide=1&controls=0&loop=0&modestbranding=0&rel=0&showinfo=0" align="center" 
maskchildren="true" onloaded="registercontentsize(640,390);"/>
</krpano>


This gives me an XML error in the line with the youtube-url:

error on line 4 at column 80: EntityRef: expecting ';'

and a download error in the player

Any ideas, what's wrong?

Yours, Michael

This post has been edited 2 times, last edit by "mstoss" (Jul 24th 2013, 10:38pm)


20

Wednesday, July 24th 2013, 9:16pm

Hi,

the link is wrong - it doesn't point to the embeddable Flash version!

Youtube links with '.../watch?v=...' are just normal links - see a few posts above for how to rewrite the url.


Regarding the xml errors - the & characters are normally not allowed in the xml (but the Flashplayer accepts them anyway) - correct would be using &amp; instead of & - see here:
http://krpano.com/docu/xml/syntaxrules/#characters

Best regards,
Klaus