View Full Version : How to link youtube video to my channel or website
biomike
02-10-2010, 03:50 PM
I have uploaded a Youtube video to my website http://www.bioenergyhealing.org.uk/test
If you click on the video at the end it goes to the general youtube page. i would like it to link to my own youtube channel http://www.youtube.com/bioenergyhealing or otherwise my video page on my website http://www.bioenergyhealing.org.uk/video
Has anyone got any suggestions.
Thanks
Michael
Add this to the youtube code:
<param name="wmode" value="transparent">
Add this to the embed object:
wmode="transparent"
and then make a link or div or whatever position absolute and put it over the video. (only the video not the controls) If you provide some code I can probably fix it.
Also you can hold out there may be an incredibly better way to do this, I just picked the first way that came to mind. I used the simple way.
More on this: http://www.electrictoolbox.com/div-layers-float-over-flash-vimeo-youtube/
Tim
edit to my edit: wrong post sorry :)
biomike
02-10-2010, 04:05 PM
Hi Tim
Thanks for your suggestion the code is
<object width="560" height="340"><param name="movie"
value="http://www.youtube.com/v/JTttSMPz3Y4&hl=en_GB&fs=1&">
</param><param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/JTttSMPz3Y4&hl=en_GB&fs=1&"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="560" height="340"></embed></object>
I feel the best implementation would be through Flash, which I have NO skill in. It can be done through JavaScript if you would still like it though, I'd be happy to.
EDIT: I have something kind of working through JavaScript.
Issues remaining are:
You can't use the controls like volume or quality (the ones that overlap onto the video) - play/pause, seeker, and fullscreen work.
The first click registered within the Flash is when the link becomes active. So if they click volume the movie part immediately becomes a link. Or if
they pause the play button that appears within the movie will not work.
No linking in fullscreen.
anddd that's it. I do not recommend this as a permanent solution but if you need something temporarily you could maybe use it while a Flash alternative is made (or a better JS one). You could workaround some problems (disable fullscreen).
As well as the YouTube app appears to allow JS access (maybe?) but I don't know how to use that so my simple script could be improved if this works like it appears. I could give you what I have and you can work with it if you like.
Let me know,
Tim
Here's the code. Do with it what you like, it's simple no harm if you don't use it. Sorry I couldn't be more help, I don't have any experience with Flash. When I started I didn't for see some issues.
Put this in the head:
<script type="text/javascript">
function youClick() {
var cheight = document.getElementById('youclicklink').style.height;
String(cheight);
cheight = cheight.replace('px','');
cheight = parseInt(cheight);
document.getElementById('youclicklink').style.height = cheight-25+'px';
document.getElementById('youclicklink').style.display = 'block';
}
</script>
This is your movie:
<a href="yoururl" style="display: block; position: absolute; width: 560px; height: 340px; display: none;" id="youclicklink"></a>
<object width="560" height="340" onclick="youClick();">
<param name="movie" value="http://www.youtube.com/v/JTttSMPz3Y4&hl=en_GB&fs=1&">
</param>
<param name="wmode" value="transparent"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/JTttSMPz3Y4&hl=en_GB&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="560" height="340"></embed></object>
You URL goes where it says...well yoururl. The height and width of the link (the red numbers) should be the height and width of the YouTube video.
Also, notice on the <object> tag I have added: onclick="youClick();"
These things will be useful should you choose to use the script/part of it.
Tim
EDIT: People might be thinking he's in the Flash forum why no Flash experience? I didn't know I was in the Flash forum actually haha I just saw it in recent posts. Sorry.
biomike
02-18-2010, 01:01 PM
Thanks for your suggestion. In the end I found a good solution
http://www.linkedtube.com/. it creates the code for you.
Michael
Glad you found what you needed! A good thing to remember (for me as well) Google before you ask, or start writing useless code. Haha. Good luck!
Tim
YasminTiara
03-17-2010, 04:02 PM
Very valuable suggestions
molendijk
03-18-2010, 01:40 AM
See THIS (http://www.dynamicdrive.com/forums/showthread.php?t=52080).
===
Arie Molendijk.
C0ldf1re
03-19-2010, 03:31 AM
Very interesting thread. Sorry I can't add anything useful yet.
I know this is an old thread, but it's the only thing I've found in about an hour of web searching which asks the exact question I want answered.
Unfortunately biomike's solution does not fit what I'm wanting to achieve. It just creates an additional button on the youtube video which can be linked to anything, but if you click the youtube icon or movie it takes you straight to the youtube page.
I need to link instead to my youtube channel. I thought this was going to be simple but perhaps not...
Got any suggestions for me? thanks in advance...
molendijk
02-21-2011, 08:11 PM
Hello rygo,
It's not difficult provided:
- you know how to use the version 3 youtube player for embedding videos (this player simply pauses when you click on any part of it except where the youtube logo is);
- you are able to exactly locate the coordinates of the logo.
The trick, then, is to place a div on top of the logo. A click on it can bring you to whatever page you want (but this is probable against the Youtube TOS).
Here's an example. If you are not able to locate the position of the youtube logo on the page (given an arbitrary video), just tell me. It's not difficult, really.
Example:
Text before video<br>
<div style="position:relative;top:10px;left:50px;width:600px; height:500px;">
<object style="position:absolute; width: 100%; height: 100%" type="application/x-shockwave-flash" data="http://www.youtube.com/v/KfSlccV9Lis?version=3&rel=0&autoplay=1&showinfo=0&start=0&autohide=0&controls=1&probably_logged_in=0">
<param name="movie" value="http://www.youtube.com/v/KfSlccV9Lis?version=3&rel=0&autoplay=1&showinfo=0&start=0&autohide=0&controls=1&probably_logged_in=0">
<param name="allowFullScreen" value="true">
<param name="wmode" value="transparent">
<param name="flashvars" value="autoplay=1">
<param name="allowNetworking" value="all">
</object>
</div><br>
<div style="position:relative;left:570px;margin-top:-40px;width:50px;height:30px;cursor:pointer;background:darkred;opacity:0.5;filter:alpha(opacity=50)" onclick="window.location.href='http://www.dynamicdrive.com'"></div><br>
Text after video
===
Arie Molendijk.
Hi molendijk
Thanks for getting back to me.
I didn't realise there was a version 3 player where a click on the screen just pauses - that's a major improvement, and I appreciate you telling me about it.
I'm trying to get a response from Google to see if there is a way to link to them without breaking the ToS, but not heard back yet, will post here if I do.
I hope that so long as you link to your youtube channel they should have no problem, but they might have other ideas!
I'll experiment with the div code you sent, I'm sure I can set this up okay, but will tell you if I have difficulties.
Thanks again :)
Rygo
molendijk
02-24-2011, 12:36 PM
I didn't realise there was a version 3 player where a click on the screen just pauses - that's a major improvement, and I appreciate you telling me about it.
See also this (http://www.dynamicdrive.com/forums/blog.php?b=49).
===
Arie.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.