• Resolved Giuseppe Maio

    (@giuseppe-maio)


    Hi everyone,
    I’m using worpress+AWS+S3 plugins and I’m trying to embed a jwplayer with its playlist in a worpress site post. I’ve uploaded some videos to S3 by means of the wordpress and they are available to embedding inside WordPress. Then, I’ve built a playlist with the videos already uploaded on s3 and I’ve inserted the new created playlist by means of the option “Insert JWP Playlist”->”Insert this player on your post”. All seems right, the player seems correctly embedded in the post but the streaming fails reporting the message “Error loading media: file not found”. What’s wrong with this procedure?
    On the other side, if I load the link to the video on S3 as external URL, it works but, unfortunately, I can’t use the playlist feature anymore. Any advice?

    https://www.ads-software.com/plugins/jw-player-plugin-for-wordpress/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author JW Player

    (@longtail-video)

    Do you have a link?

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    Hi,
    I have Amazon S3 and CloudFront setup. A couple of links that I’d like to add to JWPlayer playlist are:

    [video src="https://dgef83hbragmf.cloudfront.net/wp-content/uploads/13259_Futuridea_presentati_risultati_l_progetto_sull_ecoserra_web.mp4" /]

    [video src="https://dgef83hbragmf.cloudfront.net/wp-content/uploads/10000_Citta_del_Vino_tre_giorni_dedicle_eccellenze_del_Sannio_web.mp4" /]

    While the link to page with embedding tests is

    https://43b.60a.myftpupload.com/jwplayer-test/

    Looking forward for your precious advice.
    Kind regards,
    Giuseppe

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    Any idea?
    Unfortunately I still can’t get it working…

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    One more detail: I make a playlist picking up items loaded in my media library once videos are uploaded on S3 by means of wordpress option “Add media”->”Load file”. It seems that the jwplayer cannot play videos because the video link are truncated at file name (es. <video_file_name>.mp4) rather than have the complete Cloudfront link https://https://dgef83hbragmf.cloudfront.net/wp-content/uploads/<video_file_name&gt;.mp4
    How I can cop with this problem?

    Plugin Author JW Player

    (@longtail-video)

    This is actually working fine for me?

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    I’m sorry, but I didn’t get what you mean with your answer. More precisely, in my post I said that the player works fine but I cannot pick videos from the wp media library. The wp media library is updated automatically when I uplouad a video on S3 so I’d like to pick there the video that I’d like to add to jwplayer playlist. This is the point. If I try to add to jwplayer playlist a video already uploaded, its name is truncated to <file_name>.mp4 so that the file cannot be retrieved from s3 storage area. The only way is to add that video by means of URL external link but it seems not compatible with jwplayer playlist. What is the way then?

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    Brief update.
    I’ve tried also to add to JW Player Playlists a video of Media list but no video is displayed in the list so I’ve typed the desired video name into the text box on the right and pressed “Search media”. The media was found and I’ve added it to the playlist but the video still cannot be played because the player searches the file locally and not in S3 even if its URL points correctly to S3 location. It works only for fresh uploads which are immediately displayed in the Media list on the right.
    Why I cannot add previous uploaded files which are available in wp media library??

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    I guess that,
    since AWS+S3 wp plugin deletes files from the wp server once they have been loaded on S3, may be the Media List of the JWPlayer playlist manage panel cannot correctly address elements on S3. The thing that make me wondering is that the added media URL points correctly to the video on S3!! This is making me crazy! :/

    Plugin Author JW Player

    (@longtail-video)

    I want to see a link to where it is broken, so I can debug it. You gave me a working example link.

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    Sorry but we made some tests on the page I gave you modifying it unadvertently.
    Here is a dedicated page that you can see at https://43b.60a.myftpupload.com/jw-player-support-test/

    In this page you can two elements: one [video] element and one [jwplayer] element with a playlist. Remember that our WP use AWS+S3 plugins in order to upload media elements on S3 bucket and immediately remove them from the hosting server. This because these plygins use a two step transfer.
    Starting from a situation of already uploaded videos on S3 (and then removed from the WP hosting server), if I write a post adding a video picking it from the WP media library, it works. Note that, in this case, no JW-player and no playlist are used.
    On the other hand, if I add to the same post a JW-Player playlist, adding to the playlist the same video that I’ve added in the [video] element, it doesn’t work because it tries to stream the video from the WP hosting server (i.e. https://43b.60a.myftpupload.com/wp-content/uploads/2015/06/10002_2013_08_27_wgflash.mp4) rather than on the s3 (i.e. https://dgef83hbragmf.cloudfront.net/wp-content/uploads/10002_2013_08_27_wgflash.mp4) as it rather should do as external link.
    It seems a problem or bug of the JW-Player WP plugin in the playlist management with external links, isn’t it? How we can cop with this problem and correctly link S3 videos in JW-Player playlists??
    Thanks a lot for any advice.
    Giuseppe

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    I know that I can add an external link to JW-Player playlist but why WP can correctly address videos even if they are picked in the WP Media Library (once uploaded) while JW-Player requires that the S3 link has to be known and specified? This way, the same video is added twice to the WP Media library: the first time when I upload video file in order to embed it in its post (obtaining its link to S3) and the second time when I have to add the video as external URL to put it in the JW-playlist (using the S3 link previously obtained).
    This is because usually I need to embed the video in one post and, also, to stream it in sequence with others (playlist) in another web site section (named video section).
    Rather, I’d like to avoid the duplications of two new media elements definition and I’d like to use in the playlist the same video link that is already in the media library due to the first upload. How I can do that?

    The very strange thing is that, if I inspect the video links of videos added to the JW-Player playlist, they correctly point to S3 locations!! So that why it doesn’t play?

    Plugin Author JW Player

    (@longtail-video)

    Seems like a simple 404 error:

    “NetworkError: 404 Not Found – https://43b.60a.myftpupload.com/wp-content/uploads/2015/06/10002_2013_08_27_wgflash.mp4&#8221;

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    Are you jocking?? I already knew what the problem was! I’ve already wrote in my posts that the video was not found due the wrong link in the JW playlist. I told you that the playlist contains the wrong link when I add a video picking up from the WP Media Library…
    Sorry but you didn’t get the what the problem was! Anyway, don’t mention it because I’ve hacked the JW player plugin code and now it works fine. It is a bug of the JW-Player plugin! Bye

    Plugin Author JW Player

    (@longtail-video)

    If you really think it is our plugin issue, please email a log in to support <at> jwplayer <dot> com so we can look into the admin ourselves. Thanks! Have a nice day.

    Thread Starter Giuseppe Maio

    (@giuseppe-maio)

    I wrote an email to [email protected] but I write here that mail in order to help someone else that is facing the same problem and hoping you may consider to include it in the next plugin updates.

    The problem:
    Our WP use the AWS+S3 plugins (namely Amazon Web Services ver 0.3.1 + WP Offload S3 ver 0.9.2) so that it uploads media elements (es. videos) on the WP hosting server, then automatically loads them on S3 bucket and removes them from the WP hosting server. Now, in this condition (video on S3 and removed from the local host) If I try to add the file <video_file_name> to a JW-Player playlist picking it from the WP Media Library, it is added to the jwplayer playlist but it won’t play reporting “Error loading media: file not found”.
    This because it tries to stream the video from the local WP hosting server, i.e. from https://<my_local_hosting_server>/wp-content/uploads/video_file_name) , rather than from Amazon CDN i.e. https://dgef83hbragmf.cloudfront.net/wp-content/uploads/video_file_name as it should be.

    The solution:
    Pleas, modify file amazon-s3-and-cloudfront.php of your current plugin (ver 2.1.14) adding the following lines at line 654

    //jwplayer hack
                                                                   //cancella riga in post meta corrispondente al media contenente il link locale
                                                                   delete_post_meta( $post_id, '_wp_attached_file' );
                                                                   //tiro fuori il dominio del bucket col percorso specificato nei settings
                                                                   $domain_bucket = $this->get_s3_url_domain( $s3object['bucket'], $region, $args['Expires'] );
    
                                                                   //aggiunto riga in post meta corrispondente al media col nuovo link
                                                                   add_post_meta( $post_id, '_wp_attached_file', $domain_bucket . $prefix . $file_name );
    
                                                                   global $wpdb;
    
                                                                   $wpdb->update(
                                                                                  $wpdb->prefix . 'posts',
                                                                                  array(
                                                                                                  'guid' => 'https://'.$domain_bucket .'/'. $prefix . $file_name,    // string
                                                                                  ),
                                                                                  array( 'ID' => $post_id ),
                                                                                  array( '%s'    ),
                                                                                  array( '%d' )
                                                                   );
Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Jwplayer playlist with Amazon S3 doesn't work’ is closed to new replies.