Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

sharing plugin and swfobject 2

15 replies [Last post]

hello all... having a little trouble with the rocket science ...

The only code I could get to work seems to be new and doesn't have any documentation anywhere... ...I was hoping someone could help me out with the new code or set me up with the the older code so I can use the tutorials ..

In an ideal situation, I would like a player to play flv files, have a playlist on the side, have the sharing/embed option and play an advertisement before each video.. is this possible?

this is what I have so far

<html>
<head>
<title>test</title>
<style type="text/css">
#wrapper { position:absolute; left:0px; top:0px; width:531; height:259; }
</style>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">

function createPlayer(theFile) {
var flashvars = {
file:theFile,
autostart:"false",
playlistsize:"211",
dock:"true",
playlist:"right",
abouttext:"google",
aboutlink:"http://google.com",
frontcolor:"#ffffff",
lightcolor:"#ffffff",
backcolor:"#9d241a",
plugins:"sharing.code",
plugins:"adtvideo",
'adtvideo.config':"ads.xml",
}
var params = {
allowfullscreen:"true",
allowscriptaccess:"always",
bgcolor:"#000000",
}
var attributes = {
id:"player1",
name:"player1",
}
swfobject.embedSWF("player.swf", "placeholder1", "531", "259", "9.0.115", true, flashvars, params, attributes);
}
</script>

<body onload="createPlayer('test.xml')" bgcolor="#000000">
<br>
<br>
<div id="wrapper">
<div id="placeholder1"></div>
</div>

</body>

</html>

do I need the older swfobject.js to get the sharing plugin to work?
I'll pay for some help...anyone want to make some $ ?

You should contact Longtail Video directly for help because only licensees have access to the User Guide and the Installatin Manual.

http://www.longtailvideo.com/support/contact-us

This is about the best that I can do with your code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

  <head>

    <title>test</title>

    <style type="text/css">
      div.playercontainer
      {
        position:            absolute;
        left:                       0;
        top:                        0;
        width:                  531px;
        height:                 259px;
      }
    </style>

    <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>

    <script type="text/javascript">
      var flashvars =
      {
        'file':                       'test.xml',
        'playlist':                   'right',
        'playlistsize':               '211',
        'dock':                       'true',
        'abouttext':                  'google',
        'aboutlink':                  'http://google.com',
        'frontcolor':                 'ffffff',
        'lightcolor':                 'ffffff',
        'backcolor':                  '9d241a',
        'plugins':                    'adtvideo',
        'adtvideo.config':            'ads.xml',
        'id':                         'playerID',
        'autostart':                  'false'
      };

      var params =
      {
        'allowscriptaccess':          'always',
        'allowfullscreen':            'true',
        'bgcolor':                    '#000000'
      };

      var attributes =
      {
        'id':                         'playerID', 
        'name':                       'playerID'
      };

      swfobject.embedSWF('player.swf', 'player', '531', '259', '9.0.124', true, flashvars, params, attributes);
    </script>

  </head>

  <body bgcolor="#000000">

    <br>
    <br>
    <div id="playercontainer" class="playercontainer"><a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a></div>

  </body>

</html>

I'm not sure which sharing plugin you are referring to, so I didn't include it in the code.

Hi Neil,

You can only define each variable once, so

plugins:"sharing.code",
plugins:"adtvideo",

would need to become

plugins:"sharing,adtvideo"

Test that out - if you're still having trouble, please post a link to a page demonstrating the error.

You should contact Longtail Video directly for help because only licensees have access to the User Guide and the Installatin Manual.

Just to be clear, this is the case for certain plugins (generally, Ad plugins), but not for the player itself. All of the documentation for the player is available.

thanks for the reply guys ... much appreciated :)

the code you gave works, but seems to be yet another version...is this the latest? is there a reason why there are so many?

I'm fully licensed for the player and adtonomy... the sharing plugin looks to be free and that's the only thing I have left to get working.

the code for sharing in the guide reads:

<script type="text/javascript">
var so = new SWFObject('http://www.yoursite.com/player.swf',
'mpl','400','320','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars',
'file=/upload/flash.flv
&plugins=sharing-1&sharing.link=http://bigbuckbunny.org/index.php/trailer-page/&sharing.code=%3Cembed%20src%3D%22http%3A%2F%2Fdevelo...);
so.write('mediaspace');
</script>

are you able to convert that so I can add it to mine?

Longtail helped me out with that other code and got me to where I am... but that's different code... and neither of these codes are the version referred to in the guide... so confusing .. lol .. they also said running the ads before each video in a playlist isn't possible, so I was just wondering if any of the highly intelligent people in here have found a work-around for it..

Nobody can read that code, that's why we have computers to do the hard stuff!
First, separate the flashvars:

so.addVariable('file',          '/upload/flash.flv');
so.addVariable('plugins',       'sharing-1');
so.addVariable('sharing.link',  'http://bigbuckbunny.org/index.php/trailer-page/');
so.addVariable('sharing.code',   escape('<embed src="http://developer.longtailvideo.com/player/trunk/as3/player.swf" flashvars="file=../testing/files/bunny.mp4" width="400" height="300" />'));

Then use JavaScript's escape() method to do the hard work. Adjust the sharing code to your site, file, etc.

The Rosetta Stone for urlencoding is here: http://i-technica.com/whitestuff/urlencodechart.html

As Zachary mentioned, if you want to use two plugins, they go in a comma-separated list  —NO SPACES—  like this:

so.addVariable('plugins',       'adtvideo,sharing');

wow...so fast... you rock man!!!

while you're here... maybe you can save me a few hours of looking around... can I call a playlist into the player from a text link outside of the player? and if so, would the ads play before each video now that it's a new playlist?
and if we can't get the playlist thing to work, would the ad play before each video if we just called up a single video from the text link outside the player?

does that make sense? ..lol

Longtail said they were working on an update for adtonomy that will eliminate this issue...but I'm looking to launch a website right away and we need the revenue from as much ad space as we can squeeze in .. :)

Where's the text link?

Same page: http://www.longtailvideo.com/support/forum/Setup-Problems/16895/Adding-Links-underneath-embedded-Fla...

Test Page: http://willswonders.myip.org:8074/Simple_AddItem.html

Different page: http://www.longtailvideo.com/support/forum/JavaScript-Interaction/17884/Link-from-another-page-to-sp...

Test Page: http://willswonders.myip.org:8074/callingpage.html

You can send all of the file properties (and other flashvars also), but the most useful are file, item (track index), and title.

I think you could "trick" the player into playing an ad before each track by re-loading the playlist.

How do you expect tracks to be selected? By the user selecting a track or by automatically playing through the playlist?

Seems that the trick is to stop the player when a track has completed, then index to item 0, remembering what track is to be plaed next.

This causes the ad to play again, then the next-in-order track is played.

Works OK, but the same ad is always played before each track. I don't know if the Adtonomy Video plugin allows for a list of ads to be played in succession.

I think it would be best to wait for Longtail Video to update the plugin, so it has the option of playing a different ad before each track.

can you convert and add this

so.addVariable('plugins', 'sharing-1');
so.addVariable('sharing.link', 'http://bigbuckbunny.org/index.php/trailer-page/');
so.addVariable('sharing.code', escape('<embed src="http://developer.longtailvideo.com/player/trunk/as3/player.swf" flashvars="file=../testing/files/bunny.mp4" width="400" height="300" />'));

to this

<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>

<script type="text/javascript">
var flashvars =
{
'file': 'test.xml',
'playlist': 'right',
'playlistsize': '211',
'dock': 'true',
'abouttext': 'google',
'aboutlink': 'http://google.com',
'frontcolor': 'ffffff',
'lightcolor': 'ffffff',
'backcolor': '9d241a',
'plugins': 'adtvideo',
'adtvideo.config': 'ads.xml',
'id': 'playerID',
'autostart': 'false'
};

var params =
{
'allowscriptaccess': 'always',
'allowfullscreen': 'true',
'bgcolor': '#000000'
};

var attributes =
{
'id': 'playerID',
'name': 'playerID'
};

swfobject.embedSWF('player.swf', 'player', '531', '259', '9.0.124', true, flashvars, params, attributes);
</script>

--------

I see so many really ugly players that have the ability to run ads... I don't get why it's so hard for this one to do it.. but I'm still trying to make something work...lol ... I paid the $ for damn thing

would you be able to post the code (in the format used above) to make the adtonomy plugin work with this page so the same ad will play when each link is clicked? http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_xmpl_3-1-1-2.html

more thoughts....

inside the ad.xml code, there is a line to manipulate the controls...
<controls show_pause="false" show_skip="false" show_mute="false" countdown_message="00s"/>

is there any way to manipulate the controls in the player from within a playlist or from a link outside the player?

var flashvars =
{
  'file':               'test.xml',
  'playlist':           'right',
  'playlistsize':       '211',
  'dock':               'true',
  'abouttext':          'google',
  'aboutlink':          'http://google.com',
  'frontcolor':         'ffffff',
  'lightcolor':         'ffffff',
  'backcolor':          '9d241a',
  'plugins':            'adtvideo,sharing-1',
  'adtvideo.config':    'ads.xml',
  'sharing.link':       'http://bigbuckbunny.org/index.php/trailer-page/',
  'sharing.code',        escape('<embed src="http://developer.longtailvideo.com/player/trunk/as3/player.swf" flashvars="file=../testing/files/bunny.mp4" width="400" height="300" />')),
  'id':                 'playerID',
  'autostart':          'false'
};

Generally speaking, there is no control of the player from a playlist. (The link can contain JavaScript which is executed when the user clicks on the link.)

You do have full control of the player through the JavaScript API.

Put this code in the head of your HTML document to get access to the player reference object:

    <script type="text/javascript">
      var player = null;

      function playerReady(obj)
      {
        player = gid(obj.id);
      };

      function gid(name)
      {
        return document.getElementById(name);
      };
    </script>

Then use any clickable (JavaScript onclick) element (division, image, anchor, etc) to control the player.

<a href="#" onclick="player.sendEvent('PLAY', 'true');">PLAY</a>

PLAY, STOP, LOAD, SEEK, and the other player control commands (the View Events except FULLSCREEN) are available. See: http://developer.longtailvideo.com/trac/wiki/FlashEvents#Viewevents

HI lost..I can't get it to work... http://www.netvid.tv/lost/ultimatecode.htm

I'm willing to pay for help with this.. credit card, paypal or whatever.. lost or anyone else.. I've wasted so much time trying to get this to work that I should have just bought the brightcove player.. longtail needs to post the proper instructions for their product.. having customers looking all over their site for little snippets of code and trying to figure out which works with what version of swfobject is very unprofessional.

I would like this player (or another one if you know of any) to play a single flv file or a playlist from a link outside the player on the same page.
The player has to play a video advertisement prior to each video selected,
The player has to have the share/embed links.

*if an advertisement can't be played before each video selected, can we block use of the play/skip controls of the first video in a playlist?*

that's it.. sounded simple according to the sales pitch by longtail.... that's why I bought it..

this is all I could get working http://www.netvid.tv/lost/test2.htm

Neil,
Did you ever get this to work? I want to do the same thing but I'm VERY hesitant to commit to Longtail because the documentation seems so disjointed and support of the forums seems non-existant.

For example, I spent an entire day reading about a dozen web pages just to get the basic embedded player example to work.

Did you find an alternative that did what you needed?

Thanks for any help or advice,
-=beeky

We support everything you've listed Neil, except

The player has to play a video advertisement prior to each video selected,

We'll be adding this functionality in a future release of Adtonomy.

Confirming the above restriction - as a licensed user, I'm also looking for this functionality.

C.

Hi all, I need tips and help

why is below code not working?

so.addVariable('sharing.code', 'javascript:document.getElementById(\mediaSpace\).innerHTML');

is it possbile to add a javscript funtion to plugin sharing.code ....I would like to put the all content from id=mediaSpace

many thanks