Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->DVD Profiler: Layouts and Reports Page: 1... 3 4 5 6 7 ...11  Previous   Next
YouTube/Google Video HTML Window
Author Message
DVD Profiler Desktop and Mobile RegistrantMole
Ex-contributor
Registered: March 13, 2007
United Kingdom Posts: 756
Posted:
PM this userVisit this user's homepageDirect link to this postReply with quote
Quoting pauls42:
Quote:
Quoting Mole:
Quote:

and what do I design these days.......look left....it's a clue 


paper planes? 


Funny you should mention that.......

Having just got 5A up in service we were all given the usual collection of fine commemmerative T-shirts, stickers etc.....and a flatpack, cut-out-'n'-stick cardboard Skynet.......which will eventually hang up in my study alongside my cardboard Envisat!



And I must just say that I thought that Sir David Beckham delivered a majestic performance this evening!
Chris
 Last edited: by Mole
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting Touti:
Quote:
Now I know xyrano is gonna hate me but Videodetective.com has some nice trailers and they support embedded videos as well.  I wish I knew enough Javascript to do it myself.  That seems like a lot of code but I'm sure most of it can be removed.  The trailer ID is identified by the "PublishedID" value which I highlighted here.


<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='330' height='280' id='player' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='allowFullScreen' value='true' /><param name='FlashVars' value='PublishedID=975' /><param name='movie' value='http://www.videodetective.com/codes/player.swf' /><param name='menu' value='false' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='bgcolor' value='#ffffff' /><embed src='http://www.videodetective.com/codes/player.swf' menu='false' quality='high' wmode='transparent' bgcolor='#ffffff' width='330' height='280' name='player' align='middle' allowScriptAccess='sameDomain' allowFullScreen='true' type='application/x-shockwave-flash' flashvars='PublishedID=975' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>

Xyrano, if you feel you've done enough I can try to do it myself this coming week-end.

Hehe, you'll receive no hate from me, m8
...and you are all welcome to do with it what you wish...

http://www.videodetective.com/codes/player.swf?PublishedID=975
seems to work well in a browser (linkable), I'll have to test to see if this 'player' will work in the current '<object..>' code (without all that extra stuff), if it does, then its all good.

In fact, I have code here that will take this to the next level. How about an option to specify a player virtually? Meaning, the code does not rely on hard coded urls and paths anymore

Okay, it's not finished yet, so stay tuned.

Quote:
LOL... are you sorry you read this thread yet xyrano??

I'm sorry, I don't know what you mean...

Quote:
And we now have a decent title on the thread! Thanks Ken!

And I have learned my lesson... will always make the titles descriptive from the start!

LOL, after my next release you'll want to update it again (if I can get it to work).
I am curious though, why we are not allowed to edit the subject our selfs

Quote:
How do you type ¤?

But yeah, we do need to be careful for what we use as a separator, since you never know when one of these providers will start using the designated separator character in their ID codes.

In the next I have allowed for a user defined char

...and... I remember 1975 
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
New update:
Possibly a little tough to add additional players, but there are already three players defined and you should be able to see how these three are defined. I'm using a two dimensional array for the players and the separator character (the arrays last row, look like "@" in the code). So each row is a player (except for the last row which is the separator char, and the syntax for a row is:
Quote:
["Google", "googlevideo=", "http://video.google.com/", "videoplay?docid=", "googleplayer.swf?docId=", false, []],

Just copy the entire row and paste it above the ["@"] row, edit each string within the double quotes, and possibly set the boolean to true (if you wish that the player should always be render as a link). I added this option because one of the players has autostart always on and I couldn't find another way to control it.

So whats new in the notes section then:
<videos [player attribute]=[[caption][separator] optional][clipcode] [[aslink] optional] />
- the player attribute is matched against a row in the vid array.
- caption comes before the code.

For YouTube this would be like so:
<videos youtube=code /> // Embed a youtube clip
<videos youtube=caption@code /> // Embed a youtube clip with title
<videos youtube=caption@code;caption@code /> // Embed 2 youtube clips with title
<videos ... aslink /> Render all clip(s) as link(s).

Here is the code:
Quote:
<html>
<head>
<style type="text/css">
<!--
* { color: white; font-family: verdana; font-size: 10pt; }
html, body { background-color: rgb(0, 0, 83); }
body { background-repeat: repeat-x; background-image:url($DPIMAGES.bgimage.jpg); }
h1.vid { text-align: center; }
a { font-size: 8pt; }
li { margin-left: 5pt; }
#code { clear: left; font-size: 6pt; text-align: right; margin-bottom: 15pt; }
.off { color: gray; }
.on { color: white; }
-->
</style>
<script type="text/javascript">
<!--
<DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
/*
######## Video Loader ########
@title - Video Loader
@filename - VideoLoader_1.1.1.html
@version - 1.1.1
@date - 2007-06-07
@author - xyrano
@dependencies - DVD Profiler v3+, IE.

@1.1.1 update
- Added additional Tag support (for links)

@1.1 update
- Added options for unlimited players
- Added Tag support (for verbose)

@1.0.1 update
- No video bug fixed (Thanks RossRoy)

@1.0 inital release
*/
// -------- Configuration block - Start --------
// "Player name", "Notes field attribute", "Player URL", "Player link path", "Player embed path", "Player as link"
var vid = new Array(
  ["Google", "googlevideo=", "http://video.google.com/", "videoplay?docid=", "googleplayer.swf?docId=", false, []],
  ["Video Detective", "videodetective=", "http://www.videodetective.com/", "codes/player.swf?PublishedID=", "codes/player.swf?PublishedID=", true, []],
  ["YouTube", "youtube=", "http://www.youtube.com/", "watch?v=", "v/", false, []],
  ["@"]
);
var asl = false;
var wid = 300; // a width value dividable by 25
var der = true; // Display a 'No * Available' message?

// Tags
var useTags = true;
var tagHierarchy = "9: Preferences/Video Loader/"
var tagAsLinks = tagHierarchy + "As links"; // Controlles asl from a tag
var tagVerboseOff = tagHierarchy + "Verbose off"; // Controlles der from a tag
// -------- Configuration block - End --------

var int = DP_Notes.indexOf("<videos ");
if (int != -1) {

  var d = 0;
  var hei = (wid / (d = (wid / 25))) * (d - 2);

  // Get code(s).
  // 1.1 updated
  var not = "";
  not = DP_Notes.substring(int, DP_Notes.indexOf("/>", int));
  not = not.replace("<videos ", "");
  if (not.indexOf("aslink") != -1) {
    not = not.replace("aslink", "");
    not = not.replace(/^\s+|\s+$/g, "");
    asl = true;
  }
  for (rowk in vid) {
    if (vid[rowk][0].length > 0 && not.indexOf(vid[rowk][1]) != -1) {
      var str = not.slice(not.indexOf(vid[rowk][1]), not.legnth);
      str = str.slice(0, cleanString(str, rowk));
      str = str.replace(vid[rowk][1], "");
      vid[rowk][6] = (str.indexOf(";") != -1) ? str.split(";"): str;
    }
  }

  // Tags
  // 1.1.1 updated
  if (useTags == true)  for (var i = 0;  i < DP_Tags.length;  i++) {
    if (tagAsLinks.length != 0 && DP_Tags[i].toLowerCase() == tagAsLinks.toLowerCase()) asl = true;
    if (tagVerboseOff.length != 0 && DP_Tags[i].toLowerCase() == tagVerboseOff.toLowerCase()) der = false;
  }
}

// 1.1 updated
function drawIt() {

  var html = "";
  var i = 0;
  for (row in vid) {
    if (vid[row][0].length > 1)
    if (vid[row][6] != undefined && vid[row][6] != "") {
      html += ((asl || vid[row][5]) ? vid[row][0] + ' video link': '') + selectFactory(row);
    } else {
      html += (der) ? 'No ' + vid[row][0] + ' videos Available<br />': '';
      i++;
    }
  }
  if (i==3) html = "No Videos Available<br />";
  document.getElementsByTagName('h1')[0].innerHTML = html;
}

// 1.1 updated
function selectFactory(row) {

  var obj = vid[row][6];
  var html = "";
  if (asl || vid[row][5]) {
    document.getElementsByTagName('h1')[0].className = 'on';
    if (typeof obj == "object") {
      html += "s: ";
      for (i in obj) html += '<li>' + link(vid[row][2] + vid[row][3], obj[i]) + '</li>';
    } else html += ": " + link(vid[row][2] + vid[row][3], obj);
    html += '<br />';
  } else {
    if (typeof obj == "object") for (i in obj) html += embedVideoFactory(vid[row][2] + vid[row][4], obj[i]);
    else html += embedVideoFactory(vid[row][2] +vid[row][4], obj);
  }
  return html;
}

// 1.1 updated
function embedVideoFactory(pth, str) {

  var obj = splitIt(str);
  var cde = getCode(obj);
  var eyt ='';
  eyt = '<span style="background-color: black;">';
  eyt += '<div style="background-color: black; width: ' + wid + '; height: ' + ((wid / 6) * 5) + ';">';
  eyt += '<object width="' + wid + '" height="' + ((wid / 6) * 5) + '">';
  eyt += '<param name="movie" value="' + pth + cde + '" />';
  eyt += '<param name="wmode" value="transparent" />';
  eyt += '<param name="autostart" value="false" />';
  eyt += '<embed src="' + pth + cde + '" type="application/x-shockwave-flash" autostart="false"';
  eyt += ' wmode="transparent" width="' + wid + '" height="' + ((wid / 6) * 5) + '"></embed>';
  eyt += '</object>';
  eyt += '</div>';
  eyt += '<div id="code" style="width: ' + wid + ';"';
  eyt += ' title="' + pth + cde + '"';
  eyt += ' onMouseOver="flashIt(this, true); return false;"';
  eyt += ' onMouseOut="flashIt(this, false); return false;"';
  eyt += ' class="off">' + ((typeof obj == "object") ? obj[0] + ': ': '') + cde + '</div>';
  eyt += '</span>';
  return eyt;
}

// 1.1 updated
function link(pth, str) {

  var obj = splitIt(str);
  var cde = getCode(obj);
  var lnk = '<a href="' + pth + cde + '" target="_new" onFocus="blur(this);"';
  if (typeof obj == "object") lnk += ' title="' + cde + '"';
  lnk += '>';
  lnk += (typeof obj == "object") ? obj[0]: obj;
  lnk += '</a>';
  return lnk;
}

// 1.1 new
function cleanString(str, r) {

  for (row in vid) if (vid[row][0].length > 0 && r != row && str.indexOf(vid[row][1]) != -1) return str.indexOf(vid[row][1]);
  return str.length;
}

// 1.1 new
function splitIt(str) { return (str.indexOf(vid[vid.length - 1][0]) != -1) ? str.split(vid[vid.length - 1][0]): str; }
function getCode(obj) { return ((typeof obj == "object") ? obj[1]: obj).replace(/^\s+|\s+$/g, ""); }

// 1.0
function flashIt(obj, bool) { obj.className = (bool) ? 'on': 'off'; }
//-->
</script>
</head>
<body onload="drawIt();" scroll="auto">
<h1 class="vid"></h1>
</body>
</html>

Enjoy! 
 Last edited: by xyrano
DVD Profiler Unlimited RegistrantStar ContributorAddicted2DVD
Registered: March 13, 2007
Reputation: Highest Rating
United States Posts: 17,329
Posted:
PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
Awesome!... Thanks!
Question though... how difficult would it be for me to edit the caption some? when I put it in to try on one... it shows up in the black bar under the video nicely... but it is a little small for my taste and it is like it is grayed out and turns a bright white when I do a mouse over... If it is not too hard to do I would like to make it a little bigger and make it stay the bright white the whole time without having to use a mouse over.

Edit:
Forget it... I found it myself.
Pete
 Last edited: by Addicted2DVD
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quoting Addicted2DVD:
Quote:
Awesome!... Thanks!
Question though... how difficult would it be for me to edit the caption some? when I put it in to try on one... it shows up in the black bar under the video nicely... but it is a little small for my taste and it is like it is grayed out and turns a bright white when I do a mouse over... If it is not too hard to do I would like to make it a little bigger and make it stay the bright white the whole time without having to use a mouse over.

Edit:
Forget it... I found it myself.

Hehe... simplest way to affect without actually edit the javascript parts is:
#code { clear: left; font-size: 10pt; text-align: right; margin-bottom: 15pt; }
.off { color: white; }
.on { color: white; }
DVD Profiler Desktop and Mobile RegistrantTouti
Registered: March 13, 2007
Canada Posts: 582
Posted:
PM this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
xyrano you're a genius.  I'd buy you a beer if I was in sweden but for now I can only send you a virtual one.

Cheers  !



My 4x4 Club: Club FJ Cruiser Quebec
DVDP Français: Forum DVD Profiler Français
DVDCOL:DVD Collectors Online
Video: LG RU-42PX10
Audio: Sony DreamSystem DAVFX100W
 Last edited: by Touti
DVD Profiler Unlimited RegistrantStar ContributorAddicted2DVD
Registered: March 13, 2007
Reputation: Highest Rating
United States Posts: 17,329
Posted:
PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
Quoting xyrano:
Quote:
Quoting Addicted2DVD:
Quote:
Awesome!... Thanks!
Question though... how difficult would it be for me to edit the caption some? when I put it in to try on one... it shows up in the black bar under the video nicely... but it is a little small for my taste and it is like it is grayed out and turns a bright white when I do a mouse over... If it is not too hard to do I would like to make it a little bigger and make it stay the bright white the whole time without having to use a mouse over.

Edit:
Forget it... I found it myself.

Hehe... simplest way to affect without actually edit the javascript parts is:
#code { clear: left; font-size: 10pt; text-align: right; margin-bottom: 15pt; }
.off { color: white; }
.on { color: white; }


LOL... yup... that is exactly the way I did it... I also decided to male the text align left instead of right... just personal preference showing it's ugly head! 
Pete
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
Quote:
xyrano you're a genius.  I'd buy you a beer if I was in sweden but for now I can only send you a virtual one.

Cheers  !

Cheers !
I'll soon enjoy one in the evening sun... ahhhhh!!!

Quote:
LOL... yup... that is exactly the way I did it... I also decided to male the text align left instead of right... just personal preference showing it's ugly head!



Ehum, maybe, someone wants it top right? Oh... man... didn't think of that...
...ok, it's on the todo...
DVD Profiler Unlimited RegistrantStar ContributorAddicted2DVD
Registered: March 13, 2007
Reputation: Highest Rating
United States Posts: 17,329
Posted:
PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
LOL... well if you want to put something on a todo list  ... how about this... 

Now I have an embedded trailer for 13 Going on 30 (gotta love Jennifer Garner!)

So under the video it says... Trailer: 6k74VTwbC-Q

Is there any way ro make it just say trailer and not show the youtube code?? 
Pete
DVD Profiler Unlimited RegistrantRossRoy
Registered: March 13, 2007
Posts: 793
Posted:
PM this userDirect link to this postReply with quote
I did a little modification to my Video window. Here's what it looks like now if there is no video in the profile:



As you probably already guessed, it launches searches on either YouTube or GoogleVideo using the Title. I couldn't work out how to launch the search on videodetective directly, but I still put the link there to launch the website.

If you are interested, find this line:
Quote:

  if (i==3) html = "No Videos Available<br />";


and replace it with:
Quote:

  if (i==3) {
    html = "No Videos Available<br /><br />"
    html += "<a target='_blank' href='http://www.youtube.com/results?search_query=" + DP_Title + "&search=Search'>Search YouTube</a><br />"
    html += "<a target='_blank' href='http://video.google.com/videosearch?q=" + DP_Title + "'>Search Google Video</a><br />"
    html += "<a target='_blank' href='http://www.videodetective.com/'>Open VideoDetective.com</a><br />";
  }


Hope you enjoy!
 Last edited: by RossRoy
DVD Profiler Unlimited RegistrantStar ContributorAddicted2DVD
Registered: March 13, 2007
Reputation: Highest Rating
United States Posts: 17,329
Posted:
PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
That is a cool idea Ross... before I update mine with that... does it just open IE or will it open your default browser? I really hate to use IE!

Edit:
I decided to just try it out... it does indeed just open IE... would you know how I could edit it to make it open the default browser instead?
Pete
 Last edited: by Addicted2DVD
DVD Profiler Unlimited RegistrantRossRoy
Registered: March 13, 2007
Posts: 793
Posted:
PM this userDirect link to this postReply with quote
Quoting Addicted2DVD:
Quote:
I decided to just try it out... it does indeed just open IE... would you know how I could edit it to make it open the default browser instead?


I have no idea. Is it even possible? Because DVD Profiler uses IE to render the pages, and those are just links, it may not be possible.
DVD Profiler Desktop and Mobile Registrantpauls42
Reg: 31/01/2003
Registered: March 13, 2007
United Kingdom Posts: 2,692
Posted:
PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
Quoting Addicted2DVD:
Quote:

I decided to just try it out... it does indeed just open IE... would you know how I could edit it to make it open the default browser instead?


I don't think that will be possible since its the operating system which is taking over at this point and that is hardcoded to use the IE engine. (as far as I know - I have no idea about Vista).
Paul
DVD Profiler Unlimited RegistrantStar ContributorAddicted2DVD
Registered: March 13, 2007
Reputation: Highest Rating
United States Posts: 17,329
Posted:
PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
Thanks... was worth a try at least... Will just continue to do it the old fashion way (Yes I hate IE that much)
Pete
DVD Profiler Unlimited Registrantxyrano
41215.reg 70320.urk
Registered: March 13, 2007
Sweden Posts: 646
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
RossRoy: Excellent addition!

Anyone else have an altered piece of code that others might find useful (to include in next update)?
DVD Profiler Unlimited RegistrantStar ContributorAddicted2DVD
Registered: March 13, 2007
Reputation: Highest Rating
United States Posts: 17,329
Posted:
PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
Well... I don't have a code for it... but did you see this suggestion from me?

Quoting Addicted2DVD:
Quote:
LOL... well if you want to put something on a todo list  ... how about this... 

Now I have an embedded trailer for 13 Going on 30 (gotta love Jennifer Garner!)

So under the video it says... Trailer: 6k74VTwbC-Q

Is there any way to make it just say trailer and not show the youtube code?? 


Pete
    Invelos Forums->DVD Profiler: Layouts and Reports Page: 1... 3 4 5 6 7 ...11  Previous   Next