If you can include support for livestream.com, preferable both with and without chat option, that would be swell.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aaron’s picture

Status: Active » Postponed

patches are welcome. with and without chat option. that would be swell too :D

Sheldon Rampton’s picture

Status: Postponed » Patch (to be ported)
FileSize
12.87 KB

I'm attaching a patch adding a file livestream.inc to directory contrib/emvideo/providers that seems to work for embedding video from Livestream.com. I'd appreciate it if someone could look it over and consider adding it to the module.

It seems to work well enough for our website, but it's still a bit incomplete. For example, Livestream has an API for retrieving thumbnail images, but I didn't want to take the time to code that part, so I just hard-coded a URL to a single thumbnail image of ours. If someone wants to use my patch for their own website, therefore they would want to change that part.

youkho’s picture

definitely a good start thanks Sheldon

micahw156’s picture

Status: Patch (to be ported) » Needs work

I couldn't get this to work for me. The problem I encountered was that it appeared to simply bring the URI over into $embed for use in theme_emvideo_livestream_flash().

The resulting code left flashVars set to "channel=channelname/video?clipId=pla_513a86e5-8..." but it needs to be "channel=channelname&clipId=pla_513a86e5-8..."

I did an ugly hack to get this working with str_replace on $embed to make it work, but I'm sure that's not the right way to fix it. I didn't have time to fully research where this should be modified.

Also, it appears that references to static.livestream.com should probably be replaced with cdn.livestream.com.

Sheldon Rampton’s picture

Could you attach a copy of your hacked version so I can take a look at it?

micahw156’s picture

Sheldon,

Here are my changes from your patch in #2 above:

--- livestream.inc.orig 2010-04-10 14:21:31.000000000 -0400
+++ livestream.inc      2010-04-10 17:52:52.000000000 -0400
@@ -211,18 +211,22 @@
     $autoplay = isset($options['autoplay']) ? $options['autoplay'] : variable_get('emvideo_livestream_autoplay', 1);
     $autoplay_value = $autoplay ? 'true' : 'false';

+    // Micah's ugly hack.
+    $embed = str_replace('?', '&', $embed);
+    $embed = str_replace('clipId', 'clip', $embed);
+
 //    $id = isset($options['id']) ? $options['id'] : 'emvideo-livestream-flash-'. (++$count);
     $div_id = isset($options['div_id']) ? $options['div_id'] : 'emvideo-livestream-flash-wrapper-'. $count;

     $output .= <<<FLASH
       <div id="$div_id"><object width="$width" height="$height" id="livestreamPlayer"
         classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
-        <param name="movie" value="http://static.livestream.com/grid/LSPlayer.swf"></param>
+        <param name="movie" value="http://cdn.livestream.com/grid/LSPlayer.swf"></param>
         <param name="flashVars"
           value="channel=$embed&autoPlay=$autoplay_value&mute=false"></param>
         <param name="allowScriptAccess" value="always"></param>
         <param name="allowFullScreen" value="$fullscreen_value"></param>
-        <embed id="livestreamPlayer" src="http://static.livestream.com/grid/LSPlayer.swf"
+        <embed id="livestreamPlayer" src="http://cdn.livestream.com/grid/LSPlayer.swf"
           flashVars="channel=$embed&autoPlay=$autoplay_value&mute=false"
           width="$width" height="$height" allowScriptAccess="always" allowFullScreen="$fullscreen_value"
           type="application/x-shockwave-flash"></embed>

Again, I'm pretty sure this is a bad way to do this. I also had to fudge the video URL to make this work, too.

For example, the actual URL from Livestream was like this:

http://www.livestream.com/channelname/video?clip=pla_513a86e5-.....

and I had to do this to make it work:

http://www.livestream.com/channelname?clip=pla_513a86e5-.....

I think this really needs to be changed where the URL is parsed, not on the output side, but I can't figure out which function should get these changes.

Micah

Sheldon Rampton’s picture

Thanks for the code. I'll probably need to do some follow-up with Livestream to figure some of this out.

micahw156’s picture

I made some more progress on this tonight. I think the better place for the fix will be to make changes to the emvideo_livestream_data() function, then change the calls to theme_emvideo_livestream_flash to incorporate the $item value as an argument. (The $item array is available to the emvideo_livestream_video() and emvideo_livestream_preview() functions, so that part won't be a problem.)

For a first pass at updating emvideo_livestream_data(), it should be possible to just hack apart the $item['value'] string and return $item['channel'] and $item['clip'] values that can replace the $embed string now used by the theming function. It's probably not even worth doing an API call to LiveStream to make this work. Right now, the call to emfield_request_header is only getting the header for the wrapper page on LiveStream's site, so the values it's returning aren't helpful.

I can't promise I'll have time to work on this, so I'll leave it unassigned for now, but if I get a chance, I'll take a crack at this one.

Ultimately it would be nice to do some actual API calls to LiveStream and grab the desired data for the flash video and thumbnail, but this probably isn't a bad next step.

XiaN Vizjereij’s picture

FileSize
12.56 KB
13.27 KB

I attached my version with some additions ( based on the last patches + bugfixes )

Added features

-> Thumbnail creation for Livestream links coming from API RSS calls ( It will NOT work for copy&pasted links from livestream .. i will provide a patch for that soon. Currently it ONLY works for links from the RSS API of livestream )
-> Fall back to {ThemeDir>}/no-pre.png if the API call to the thumbnail function on livestream failed ( so it will show {ThemeDir}/no-pre.png if this module couldn't get a thumbnail from livestream for the current video ). Unreproducible, the livestream api 2.0 fails to get the thumbnail. This is a reported bug in the livestream api.
-> Player integration works again. Fixed some problem with the flash player integration ( they changed some variables )

Tested features

-> Autoplay / AllowFullscreen ( both are working correctly for thousands of nodes )

Open issues

-> Support for the 1.0 API will disappear soon. We NEED to update the provider to the 2.0 api asap !
-> You can only request 10 api calls per second. This might not be an issue for your "normal" side, but its an extremely high priority for big sides. I messed around with manually ( without api calls ) getting the thumnail, but i can't find a way to get the right path manually. It would save a LOT of api calls, if we could fetch the thumbnail without a api call.
-> Support for normal copy&pasted links from livestream ( will do that soon )

Alex UA’s picture

Version: 6.x-1.12 » 6.x-2.x-dev
Status: Needs work » Closed (won't fix)
Issue tags: +emfield provider request

This really needs its own Media: Livestream.com module created for it. Marking as won't fix, as we won't be adding this to emfield. If you'd like, I'm fine with adding it to the Media: Video Flotsam module for now.

sftranna’s picture

can anyone plz complete this module or atleast organize it in a folder so that a newbie ,like me, can use it

plz help me

Regards
shahzeb Chohan

mixedfeelings’s picture

has there been any luck getting this into the Media: Video Flotsam module?

Thanks!

Alex UA’s picture

Project: Embedded Media Field » Media: Video Flotsam
Version: 6.x-2.x-dev » 6.x-1.x-dev
Component: Embedded Video Field » Code
Status: Closed (won't fix) » Fixed

I added this to Media: Video Flotsam dev. It will be available in the full release when I roll a new one...

napounet’s picture

Subscribe

Status: Fixed » Closed (fixed)
Issue tags: -emfield provider request

Automatically closed -- issue fixed for 2 weeks with no activity.