Plugin Directory

Changeset 2260164


Ignore:
Timestamp:
03/12/2020 09:11:31 PM (6 years ago)
Author:
team-ok
Message:

Fixed compatability issues with manually entered video urls that don't end with a file extension. Now mp4-MIME type is assumed in this cases.

Location:
switch-video-quality
Files:
3 edited
4 copied

Legend:

Unmodified
Added
Removed
  • switch-video-quality/tags/1.5.3/js/svq_admin.js

    r1770526 r2260164  
    220220    var fileType = url.split('.').pop();
    221221    switch (fileType) {
    222       case 'mp4':
    223         return 'video/mp4';
    224         break;
    225222      case 'webm':
    226223        return 'video/webm';
     
    230227        break;
    231228      default:
    232         return 'invalid';
     229        return 'video/mp4';
    233230    }
    234231  }
     
    242239    if ($.trim(url).length > 0) {
    243240      var fileType = getFileType(url);
    244       if (fileType == 'invalid'){
    245         wrapper.append('<p class="svq_error">'+svq_admin_l10n.urlError+'</p>');
    246       } else {
    247         getVideoHeight(wrapper, url, function(h,d){
    248           wrapper.find('.video_quality_order').val(h);
    249           wrapper.find('.video_quality_label').val(h + 'p');
    250           var hours = Math.floor(d / 3600);
    251           var minutes = Math.floor(d % 3600 / 60);
    252           var seconds = Math.round(d % 60);
    253           var duration = (hours > 0 ? hours + ':' : '') + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
    254           wrapper.find('.video_quality_duration').val(duration);
    255         });
    256         wrapper.find('input.video_quality_mime').val(fileType);
    257       }
     241      getVideoHeight(wrapper, url, function(h,d){
     242        wrapper.find('.video_quality_order').val(h);
     243        wrapper.find('.video_quality_label').val(h + 'p');
     244        var hours = Math.floor(d / 3600);
     245        var minutes = Math.floor(d % 3600 / 60);
     246        var seconds = Math.round(d % 60);
     247        var duration = (hours > 0 ? hours + ':' : '') + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
     248        wrapper.find('.video_quality_duration').val(duration);
     249      });
     250      wrapper.find('input.video_quality_mime').val(fileType);
    258251    }
    259252  });
  • switch-video-quality/tags/1.5.3/switch_video_quality.php

    r2255308 r2260164  
    33Plugin Name: Switch Video Quality
    44Description: Switch Video Quality adds quality switch functionality to the wordpress video player to let you choose between different resolutions of a (self-hosted) html5-compatible video.
    5 Version: 1.5.2
     5Version: 1.5.3
    66Author: Timo Klemm (team-ok)
    77Text Domain: switch-video-quality
     
    2626}
    2727//Switch Video Quality Version Number
    28 define( 'SVQ_VERSION', '1.5.2' );
     28define( 'SVQ_VERSION', '1.5.3' );
    2929
    3030add_action( 'load-post.php', 'switch_video_quality_settings' );
  • switch-video-quality/trunk/js/svq_admin.js

    r1770526 r2260164  
    220220    var fileType = url.split('.').pop();
    221221    switch (fileType) {
    222       case 'mp4':
    223         return 'video/mp4';
    224         break;
    225222      case 'webm':
    226223        return 'video/webm';
     
    230227        break;
    231228      default:
    232         return 'invalid';
     229        return 'video/mp4';
    233230    }
    234231  }
     
    242239    if ($.trim(url).length > 0) {
    243240      var fileType = getFileType(url);
    244       if (fileType == 'invalid'){
    245         wrapper.append('<p class="svq_error">'+svq_admin_l10n.urlError+'</p>');
    246       } else {
    247         getVideoHeight(wrapper, url, function(h,d){
    248           wrapper.find('.video_quality_order').val(h);
    249           wrapper.find('.video_quality_label').val(h + 'p');
    250           var hours = Math.floor(d / 3600);
    251           var minutes = Math.floor(d % 3600 / 60);
    252           var seconds = Math.round(d % 60);
    253           var duration = (hours > 0 ? hours + ':' : '') + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
    254           wrapper.find('.video_quality_duration').val(duration);
    255         });
    256         wrapper.find('input.video_quality_mime').val(fileType);
    257       }
     241      getVideoHeight(wrapper, url, function(h,d){
     242        wrapper.find('.video_quality_order').val(h);
     243        wrapper.find('.video_quality_label').val(h + 'p');
     244        var hours = Math.floor(d / 3600);
     245        var minutes = Math.floor(d % 3600 / 60);
     246        var seconds = Math.round(d % 60);
     247        var duration = (hours > 0 ? hours + ':' : '') + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
     248        wrapper.find('.video_quality_duration').val(duration);
     249      });
     250      wrapper.find('input.video_quality_mime').val(fileType);
    258251    }
    259252  });
  • switch-video-quality/trunk/switch_video_quality.php

    r2255308 r2260164  
    33Plugin Name: Switch Video Quality
    44Description: Switch Video Quality adds quality switch functionality to the wordpress video player to let you choose between different resolutions of a (self-hosted) html5-compatible video.
    5 Version: 1.5.2
     5Version: 1.5.3
    66Author: Timo Klemm (team-ok)
    77Text Domain: switch-video-quality
     
    2626}
    2727//Switch Video Quality Version Number
    28 define( 'SVQ_VERSION', '1.5.2' );
     28define( 'SVQ_VERSION', '1.5.3' );
    2929
    3030add_action( 'load-post.php', 'switch_video_quality_settings' );
Note: See TracChangeset for help on using the changeset viewer.