Skip to content

Commit

Permalink
Merge pull request #8620 from kaltura/master-merge-Orion-15.2.0
Browse files Browse the repository at this point in the history
Master merge orion 15.2.0
  • Loading branch information
MosheMaorKaltura authored Jul 8, 2019
2 parents 3f6b3ef + 2147fba commit 32ce52b
Show file tree
Hide file tree
Showing 43 changed files with 1,364 additions and 697 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Orion-15.1.0
Orion-15.2.0
11 changes: 11 additions & 0 deletions alpha/apps/kaltura/lib/reports/kKavaBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,15 @@ public static function getCoordinatesForKeys($keys)
return $cache->multiGet($keys);
}

protected static function roundUpToMultiple($num, $mult)
{
$rem = $num % $mult;
if (!$rem)
{
return $num;
}

return $num - $rem + $mult;
}

}
11 changes: 0 additions & 11 deletions alpha/apps/kaltura/lib/reports/kKavaLiveReportsMgr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,6 @@ protected static function getBaseFilter($partnerId, $eventTypes, $filter)

return self::getAndFilter($result);
}

protected static function roundUpToMultiple($num, $mult)
{
$rem = $num % $mult;
if (!$rem)
{
return $num;
}

return $num - $rem + $mult;
}

protected static function alignTimeFilters($filter)
{
Expand Down
3 changes: 3 additions & 0 deletions alpha/apps/kaltura/lib/reports/kKavaRealtimeReports.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ class kKavaRealtimeReports extends kKavaReportsMgr
self::METRIC_VIEW_PLAY_TIME_SEC,
self::METRIC_AVG_VIEW_LIVE_LATENCY,
self::METRIC_AVG_VIEW_DROPPED_FRAMES_RATIO,
self::METRIC_AVG_VIEW_BUFFERING,
self::METRIC_AVG_VIEW_ENGAGEMENT,
self::METRIC_AVG_VIEW_DVR,
),
),

Expand Down
24 changes: 20 additions & 4 deletions alpha/apps/kaltura/lib/reports/kKavaReportsMgr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class kKavaReportsMgr extends kKavaBase
const METRIC_AVG_VIEW_BUFFERING = 'avg_view_buffering';
const METRIC_AVG_VIEW_ENGAGEMENT = 'avg_view_engagement';
const METRIC_AVG_VIEW_LIVE_LATENCY = 'avg_view_live_latency';
const METRIC_AVG_VIEW_DVR = 'avg_view_dvr';

//report classes
const CUSTOM_REPORTS_CLASS = 'kKavaCustomReports';
Expand Down Expand Up @@ -919,6 +920,13 @@ protected static function init()
self::METRIC_VIEW_ENGAGED_COUNT,
self::EVENT_TYPE_VIEW));

self::$metrics_def[self::METRIC_AVG_VIEW_DVR] = array(
self::DRUID_AGGR => array(self::EVENT_TYPE_VIEW, self::METRIC_VIEW_DVR_COUNT),
self::DRUID_POST_AGGR => self::getFieldRatioPostAggr(
self::METRIC_AVG_VIEW_DVR,
self::METRIC_VIEW_DVR_COUNT,
self::EVENT_TYPE_VIEW));

// complex metrics
self::$metrics_def[self::METRIC_AVG_PLAY_TIME] = array(
self::DRUID_AGGR => array(self::METRIC_QUARTILE_PLAY_TIME_SEC, self::EVENT_TYPE_PLAY),
Expand Down Expand Up @@ -1465,21 +1473,29 @@ protected static function getFilterIntervals($report_def, $input_filter)
if ($input_filter->from_date && $input_filter->to_date &&
!($input_filter->from_day && $input_filter->to_day))
{
$filter_from_date = $input_filter->from_date;
$filter_to_date = $input_filter->to_date;
if ($input_filter->interval == reportInterval::TEN_SECONDS)
{
$filter_from_date = self::roundUpToMultiple($filter_from_date, 10);
$filter_to_date = self::roundUpToMultiple($filter_to_date, 10);
}

switch ($report_interval)
{
case self::INTERVAL_START_TO_END:
$from_date = self::formatUnixtime($input_filter->from_date);
$to_date = self::formatUnixtime($input_filter->to_date);
$from_date = self::formatUnixtime($filter_from_date);
$to_date = self::formatUnixtime($filter_to_date);
break;

case self::INTERVAL_BASE_TO_START:
$from_date = self::BASE_TIMESTAMP;
$to_date = self::formatUnixtime($input_filter->from_date);
$to_date = self::formatUnixtime($filter_from_date);
break;

case self::INTERVAL_BASE_TO_END:
$from_date = self::BASE_TIMESTAMP;
$to_date = self::formatUnixtime($input_filter->to_date);
$to_date = self::formatUnixtime($filter_to_date);
break;
}
}
Expand Down
19 changes: 7 additions & 12 deletions alpha/apps/kaltura/modules/extwidget/templates/previewSuccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@
#framePlayerContainer {margin: 0 auto; padding-top: 20px; text-align: center; }
object, div { margin: 0 auto; }
</style>
<?php } else { ?>
<style>
#main .content .title h1 { font-size: 24px; font-weight: bold; }
#main p { margin-bottom: 20px; font-size: 18px; }
</style>
<?php } ?>
<!--[if lte IE 7]>
<script src="/lib/js/json2.min.js"></script>
Expand All @@ -65,13 +60,8 @@
<body>
<?php if(!$framed) { ?>
<div id="main" style="position: static;">

<div class="icon"></div>
<div class="content">
<div class="title">
<h1><?php echo htmlspecialchars($entry_name); ?></h1>
</div>
<div class="contwrap">
<p><?php echo htmlspecialchars($entry_description); ?></p>
<div id="videoContainer">
<?php } ?>
<div id="framePlayerContainer">
Expand Down Expand Up @@ -174,7 +164,7 @@ function getParameterByName(name, url) {
var embedCode = '<scr'+'ipt src="'+ codeUrl +'"></scr'+'ipt><scr'+'ipt> var kalturaPlayer = KalturaPlayer.setup('+ JSON.stringify(playerConfig)+'); kalturaPlayer.loadMedia({entryId: "'+ data.entryId +'"})</scr'+'ipt>';
code = embedCode;
if (data.embedType === 'iframe') {
code = '<iframe id="kaltura_player" src="'+iframeURL+'" width="'+ width +'" height="'+height+'" allowfullscreen="" webkitallowfullscreen="" mozallowfullscreen="" allow="autoplay; fullscreen; encrypted-media" frameborder="0" style="width: '+width+'px; height: '+height+'px;" itemprop="video" itemscope="" itemtype="http://schema.org/VideoObject">';
code = '<iframe id="kaltura_player" src="'+iframeURL+'" width="'+ width +'" height="'+height+'" allowfullscreen="" webkitallowfullscreen="" mozallowfullscreen="" allow="autoplay; fullscreen; encrypted-media" frameborder="0" style="width: '+width+'px; height: '+height+'px;" itemprop="video" itemscope="" itemtype="http://schema.org/VideoObject"></iframe>';
}
document.getElementById('framePlayerContainer').style.height = height + 'px';
document.getElementById('framePlayerContainer').style.width = width + 'px';
Expand Down Expand Up @@ -205,7 +195,12 @@ function getParameterByName(name, url) {
</script>
</div>
<?php if(!$framed) { ?>
</div>
<div class="title">
<h1><?php echo htmlspecialchars($entry_name); ?></h1>
</div>
<div class="contwrap">
<p><?php echo htmlspecialchars($entry_description); ?></p>
<!--<br /><p>This page is for preview only. Not for production use.</p>-->
</div><!-- end contwrap -->
</div><!-- end content -->
Expand Down
6 changes: 3 additions & 3 deletions alpha/lib/model/DeliveryProfileVod.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,10 @@ protected function sortFlavors($flavors)
}
}
}

uasort($flavors, array($this,'flavorCmpFunction'));
return $flavors;

return array_values($flavors);
}

public function setDynamicAttributes(DeliveryProfileDynamicAttributes $params) {
Expand Down
4 changes: 2 additions & 2 deletions alpha/lib/model/Partner.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function setReturnDuplicateKshow( $v )

public function getAllowQuickEdit()
{
return $this->getFromCustomData( "allowQuickEdit" , null , true );
return (int)$this->getFromCustomData( "allowQuickEdit" , null , true );
}

public function setAllowQuickEdit( $v )
Expand Down Expand Up @@ -410,7 +410,7 @@ public function setNotificationsConfig( $v )

public function getAllowMultiNotification()
{
return $this->getFromCustomData( "allowMultiNotification" , null );
return (int)$this->getFromCustomData( "allowMultiNotification" , null );
}

public function setAllowMultiNotification( $v )
Expand Down
14 changes: 14 additions & 0 deletions alpha/lib/model/UserLoginData.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,18 @@ public function getCacheInvalidationKeys()
{
return array("userLoginData:id=".strtolower($this->getId()), "userLoginData:loginEmail=".strtolower($this->getLoginEmail()));
}

public function isTwoFactorAuthenticationRequired(kuser $dbUser)
{
$partnerIds = $dbUser->getAllowedPartnerIds();
$partners = PartnerPeer::retrieveByPKs($partnerIds);
foreach ($partners as $partner)
{
if($partner->getUseTwoFactorAuthentication())
{
return true;
}
}
return false;
}
} // UserLoginData
18 changes: 8 additions & 10 deletions alpha/lib/model/UserLoginDataPeer.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,19 +301,17 @@ public static function setInitialPassword($hashKey, $newPassword)
$loginData->resetPassword($newPassword);
myPartnerUtils::initialPasswordSetForFreeTrial($loginData);

$partner = PartnerPeer::retrieveByPK($loginData->getConfigPartnerId());
if($partner->getUseTwoFactorAuthentication())
kuserPeer::setUseCriteriaFilter(false);
$dbUser = kuserPeer::getKuserByPartnerAndUid($loginData->getConfigPartnerId(), $loginData->getLoginEmail(), true);
kuserPeer::setUseCriteriaFilter(true);
if (!$dbUser)
{
kuserPeer::setUseCriteriaFilter(false);
$dbUser = kuserPeer::getKuserByPartnerAndUid($loginData->getConfigPartnerId(), $loginData->getLoginEmail(), true);
kuserPeer::setUseCriteriaFilter(true);
if (!$dbUser)
{
throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID, $loginData->getLoginEmail());
}
throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID, $loginData->getLoginEmail());
}

if($loginData->isTwoFactorAuthenticationRequired($dbUser))
{
authenticationUtils::generateNewSeed($loginData);

return authenticationUtils::getQRImage($dbUser, $loginData);
}

Expand Down
2 changes: 1 addition & 1 deletion alpha/lib/model/kuserPeer.php
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ public static function sendNewUserMail(kuser $user, $existingUser)
if (!$existingUser) {
$resetPasswordLink = UserLoginDataPeer::getPassResetLink($user->getLoginData()->getPasswordHashKey());
}
$kmcLink = trim(kConf::get('apphome_url'), '/').'/kmc';
$kmcLink = trim(kConf::get('apphome_url'), '/').'/kmcng';
$adminConsoleLink = trim(kConf::get('admin_console_url'));
$contactLink = kConf::get('contact_url');
$beginnersGuideLink = kConf::get('beginners_tutorial_url');
Expand Down
109 changes: 97 additions & 12 deletions alpha/web/lib/css/shortlink.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api_v3/lib/KalturaBaseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function initService($serviceId, $serviceName, $actionName)

$this->partnerId = $partnerId;

// check if current aciton is allowed and if private partner data access is allowed
// check if current action is allowed and if private partner data access is allowed
$allowPrivatePartnerData = false;
$actionPermitted = $this->isPermitted($allowPrivatePartnerData);

Expand Down
4 changes: 2 additions & 2 deletions configurations/base.ini
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ studio_v3_version = v3.3.0
liveanalytics_version = v2.7.3
usagedashboard_version = v2.0.0
live_dashboard_version = v1.5.6
kmc_analytics_version = v1.2.0
kmc_analytics_version = v1.3.1
live_rtc_concurrent_streams = 2
rtc_server_node_env = prod

Expand Down Expand Up @@ -549,4 +549,4 @@ fileDescriptions[] = "XML document text";//mpd on ubuntu 14,12
fileDescriptions[] = "XML document text";//mpd on Fedora 11

[kmcng]
kmcng_version = v5.10.0
kmcng_version = v5.11.0
4 changes: 4 additions & 0 deletions infra/chunkedEncode/KChunkedEncode.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ protected static function handleForcedKeyFrames($forcedKeyFramesStr, $cmdLineArr
- gte(t__FORCED_KF_START_SHIFT__,n_forced*$gopInSecs) - the original forced KF setup with shift to the 'time 0'
- gte(t,__FORCED_KF_EXTRA_IFARMES__)*lt(t,$setExtraIFramesTimingEnd)) - generate I frames starting from half-frame before EOF chunk, till 3 frames after the chunk end (into the 2nd segement)
*/
/*
Temporally disable the handling of redundant I-Frames at the chunk end.
The 'expr' was incorrect
if(!isset($params->bf)){
if($params->vcodec=='libx264' && in_array($params->vprofile, array('main','high') ))
$forcedKeyFramesStr = "'expr:if(gte(t__FORCED_KF_START_SHIFT__,n_forced*$gopInSecs),gte(t,__FORCED_KF_EXTRA_IFARMES__)*lt(t,$setExtraIFramesTimingEnd))'";
Expand All @@ -440,6 +443,7 @@ protected static function handleForcedKeyFrames($forcedKeyFramesStr, $cmdLineArr
else if($params->bf>0)
$forcedKeyFramesStr = "'expr:if(gte(t__FORCED_KF_START_SHIFT__,n_forced*$gopInSecs),gte(t,__FORCED_KF_EXTRA_IFARMES__)*lte(t,$setExtraIFramesTimingEnd))'";
else
*/
$forcedKeyFramesStr = "'expr:gte(t__FORCED_KF_START_SHIFT__,n_forced*$gopInSecs)'";

//$forcedKeyFramesStr = "'expr:gte(t__FORCED_KF_START_SHIFT__,n_forced*$gopInSecs)'";
Expand Down
Loading

0 comments on commit 32ce52b

Please sign in to comment.