Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It is noted in http://drupal.org/node/143656 that we can call swf($array_of_files).
It is noted in http://drupal.org/node/305225 that we can call swf($file, $args).
I tried combining both ideas, to create a playlist for youtube videos.
$files = array('http://www.youtube.com/v/uikgwR8YwfQ', 'http://www.youtube.com/v/iGmUs2o2WcE');
print swf($files, array('params' => array('height' => '400', 'width' => '300'), 'methods' => array('action' => 'swftools_swf_display_direct')));
and it doesn't work.
The single file version works:
$file = 'http://www.youtube.com/v/uikgwR8YwfQ';
print swf($file, array('params' => array('height' => '400', 'width' => '300'), 'methods' => array('action' => 'swftools_swf_display_direct')));
Can anyone enlighten how I should have done it?
Thank You.
Comments
Comment #1
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedUsing action = swftools_swf_display_direct renders the video in the YouTube player, and you can't build playlists in that way. You need to retrieve just the video stream, and handle it in one of the SWF Tools media players (Wijering or Flowplayer). See this post which describes the steps that are needed.
The key points are that you need to set the action to swftools_flv_display, or swftools_flv_display_list (for single files, or playlists respectively), and that the format of the video url varies according to whether you are using Wijering or Flowplayer.
It's a bit fiddly to set up, but it can be done. However, there is a problem when using FlowPlayer3 as the "t" value changes over time!
And, when I just tried to test it locally I found a bug in the playlist function that means lists of full urls aren't properly processed either. So I need to fix that too!!
However, when the playlist function is fixed what you would write is (for FlowPlayer3)
While the code for Wijering4 would be
I'm going to open a new issue for the bug in the playlist function.