Page 1 of 1

Linking Videos\Trailers

Posted: Fri Dec 26, 2008 11:49 am
by kevindosi
I'd love the ability to link a video or trailer to each of my movies. Viewing trailers is usually a better way of deciding whether or not you want to see a movie than reading the summary.

Re: Linking Videos\Trailers

Posted: Tue Dec 30, 2008 8:16 am
by Conor
You can drag URLs or video files over the info view of the movie to link the trailers. Then the link will be present in the info view for one click browsing of the trailers. If the file is a local video file it will also show up in the full screen mode and under the optional play button on the toolbar.

Re: Linking Videos\Trailers

Posted: Wed Jan 21, 2009 4:51 am
by Nora
DVDpedia user Torsten has just sent us an update of his LeoTab info view, which now includes a direct link to YouTube for trailers. You can read about the template and download it from our extras page.

Re: Linking Videos\Trailers

Posted: Sun Oct 18, 2009 12:04 pm
by rogmabi
This info view is really cool. However, I have some trouble when it looks up in Youtube with special characters like "&" in "The fast & the furious"... Is there a way to end up with a correct result page in Youtube even if there are special characters like this one in the title ? :?:

Re: Linking Videos\Trailers

Posted: Sun Oct 18, 2009 10:07 pm
by Conor
DVDpedia has no sense of context when replacing the keys in a template, so it creates all of them for display, which is okay for a link as well, except in the case of the & character that should be %26 inside a link. I'll add that to the list of bugs, but I can't see a simple way to fix it.

Re: Linking Videos\Trailers

Posted: Sun Oct 18, 2009 11:34 pm
by rogmabi
Conor wrote:DVDpedia has no sense of context when replacing the keys in a template, so it creates all of them for display, which is okay for a link as well, except in the case of the & character that should be %26 inside a link. I'll add that to the list of bugs, but I can't see a simple way to fix it.
(Ok, perhaps with a Javascript replace() method then a javascript link() method... ? :?: ) -->> I was thinking about the export template... So I have no idea... :roll:

Re: Linking Videos\Trailers

Posted: Mon Oct 19, 2009 10:47 am
by Conor
I didn't think outside of DVDpedia, but javascript should work well as you know the context, the link is for youtube. You could pass the link to a javascript function that replaces any "&" for "%26".

Code: Select all

<a href="javascript:encodeAmp(http://www.youtube.com...[key:title])" >

<script language="JavaScript">

encodeAmp(aLink) {
aLink.replace('&','%26');
window.location = aLink;
}
</script>

Re: Linking Videos\Trailers

Posted: Mon Oct 19, 2009 11:48 am
by rogmabi
Conor wrote:I didn't think outside of DVDpedia, but javascript should work well as you know the context, the link is for youtube. You could pass the link to a javascript function that replaces any "&" for "%26".

Code: Select all

<a href="javascript:encodeAmp(http://www.youtube.com...[key:title])" >

<script language="JavaScript">

encodeAmp(aLink) {
aLink.replace('&','%26');
window.location = aLink;
}
</script>
I am new to HTML and Javascript... let's say I want to get the following link :

http://www.youtube.com/results?search_q ... finition=1

from this :

Code: Select all

<a href="http://www.youtube.com/results?search_query=[key:title]+trailer&high_definition=1"><B><font color="#FF0000" size="+4">Trailer</font></B></a>
What would be the Javascript code to add ?

I thought it would be :

Code: Select all

<a href="javascript:encodeAmp(http://www.youtube.com/results?search_query=[key:title])+trailer&high_definition=1" ><B><font color="#FF0000" size="+4">Trailer</font></B></a>
<script language="JavaScript">
encodeAmp(aLink) {
aLink.replace('&','%26');
window.location = aLink;
}
</script>
I have tried the code you gave me above but I couldn't get it working... :? Thanks

Re: Linking Videos\Trailers

Posted: Mon Oct 19, 2009 12:40 pm
by Conor
Should be it, but you need to keep the entire link together; bring in the "+trailer&high_definition=1" inside the parenthesis. Also move the script part to somewhere inside the <head> tags at the top of the page. I also added the replace for spaces in case JavaScript can't handle those.

Code: Select all

<head>
...
<script language="JavaScript">

encodeAmp(aLink) {
    aLink.replace('&','%26');
    aLink.replace(' ','%20');
     window.location = aLink;
}
</script>
...
</head>
...
<a href="javascript:encodeAmp(http://www.youtube.com/results?search_query=[key:title]+trailer&high_definition=1)" >" >


Re: Linking Videos\Trailers

Posted: Mon Oct 19, 2009 6:59 pm
by rogmabi
The code doesn't work for me... I was able to call the function (tested with an alert) but not the method .replace().... it seems not working :?

Code: Select all

<head>
...
<script language="JavaScript">

function encodeAmp(aLink) {
    aLink.replace('&','%26'); //doesn't work
    aLink.replace(' ','%20'); //not needed for my browser
    window.location = aLink;
}
</script>
...
</head>
...
<a href="javascript:encodeAmp('http://www.youtube.com/results?search_query=[key:title]+trailer&high_definition=1')" >Trailer</a>

Re: Linking Videos\Trailers

Posted: Sun Nov 01, 2009 3:25 am
by allenday
Conor wrote:You can drag URLs or video files over the info view of the movie to link the trailers. Then the link will be present in the info view for one click browsing of the trailers. If the file is a local video file it will also show up in the full screen mode and under the optional play button on the toolbar.
This used to work, but stopped working for me in the current release (4.5.3)

Re: Linking Videos\Trailers

Posted: Sun Nov 01, 2009 11:03 am
by Conor
Is the dragging not working or the playback of the file? What type of extension does the file have: .mov .avi .mpg .m4v? Thank you for the information, the more specifics I get the easier it is to try to reproduce. I tried with several different files types that I commonly use (.avi .m4v) and was working correctly.