Linking Videos\Trailers

Tell us about your wildest feature dreams. Or just harmless suggestions for improvement.
Post Reply
kevindosi
Bruji Friend
Bruji Friend
Posts: 18
Joined: Wed Oct 03, 2007 10:17 pm

Linking Videos\Trailers

Post 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.
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Linking Videos\Trailers

Post 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.
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

Re: Linking Videos\Trailers

Post 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.
rogmabi
Junior Member
Junior Member
Posts: 4
Joined: Sun Oct 18, 2009 11:50 am

Re: Linking Videos\Trailers

Post 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 ? :?:
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Linking Videos\Trailers

Post 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.
rogmabi
Junior Member
Junior Member
Posts: 4
Joined: Sun Oct 18, 2009 11:50 am

Re: Linking Videos\Trailers

Post 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:
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Linking Videos\Trailers

Post 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>
rogmabi
Junior Member
Junior Member
Posts: 4
Joined: Sun Oct 18, 2009 11:50 am

Re: Linking Videos\Trailers

Post 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
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Linking Videos\Trailers

Post 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)" >" >

rogmabi
Junior Member
Junior Member
Posts: 4
Joined: Sun Oct 18, 2009 11:50 am

Re: Linking Videos\Trailers

Post 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>
allenday
Inductee
Inductee
Posts: 1
Joined: Sun Nov 01, 2009 3:23 am

Re: Linking Videos\Trailers

Post 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)
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Linking Videos\Trailers

Post 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.
Post Reply