当前位置: 首页>>代码示例>>PHP>>正文


PHP canStreamNative函数代码示例

本文整理汇总了PHP中canStreamNative函数的典型用法代码示例。如果您正苦于以下问题:PHP canStreamNative函数的具体用法?PHP canStreamNative怎么用?PHP canStreamNative使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了canStreamNative函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: outputlivestream

function outputlivestream($monitor, $inwidth = 0, $inheight = 0)
{
    $scale = isset($_REQUEST['scale']) ? validInt($_REQUEST['scale']) : reScale(SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE);
    $connkey = $monitor['connKey'];
    // Minor hack
    //$connKey = generateConnKey();
    if (ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT) {
        $streamMode = "mpeg";
        $streamSrc = getStreamSrc(array("mode=" . $streamMode, "monitor=" . $monitor['Id'], "scale=" . $scale, "bitrate=" . ZM_WEB_VIDEO_BITRATE, "maxfps=" . ZM_WEB_VIDEO_MAXFPS, "format=" . ZM_MPEG_LIVE_FORMAT, "buffer=" . $monitor['StreamReplayBuffer']));
    } elseif (canStream()) {
        $streamMode = "jpeg";
        $streamSrc = getStreamSrc(array("mode=" . $streamMode, "monitor=" . $monitor['Id'], "scale=" . $scale, "maxfps=" . ZM_WEB_VIDEO_MAXFPS, "buffer=" . $monitor['StreamReplayBuffer']));
    } else {
        $streamMode = "single";
        $streamSrc = getStreamSrc(array("mode=" . $streamMode, "monitor=" . $monitor['Id'], "scale=" . $scale));
    }
    $width = !empty($inwidth) ? $inwidth : 150;
    $height = empty($inheight) ? $width * $monitor['Height'] / $monitor['Width'] : $inheight;
    $width = (int) $width;
    $height = (int) $height;
    if ($streamMode === "mpeg") {
        outputVideoStream('liveStream' . $monitor['Id'], $streamSrc, reScale($width, $scale), reScale($height, $scale), ZM_MPEG_LIVE_FORMAT, $monitor['Name']);
    } elseif ($streamMode == "jpeg") {
        if (canStreamNative()) {
            outputImageStream('liveStream' . $monitor['Id'], $streamSrc, reScale($width, $scale), reScale($height, $scale), $monitor['Name']);
        } elseif (canStreamApplet()) {
            outputHelperStream('liveStream' . $monitor['Id'], $streamSrc, reScale($width, $scale), reScale($height, $scale), $monitor['Name']);
        }
    } else {
        outputImageStill('liveStream' . $monitor['Id'], $streamSrc, reScale($width, $scale), reScale($height, $scale), $monitor['Name']);
    }
}
开发者ID:OverByThere,项目名称:modern,代码行数:32,代码来源:functions.php

示例2: validHtmlStr

</a>
      </div>
      <h2><?php 
echo $SLANG['Cycle'];
?>
 - <?php 
echo validHtmlStr($monitor['Name']);
?>
</h2>
    </div>
    <div id="content">
      <div id="imageFeed">
<?php 
if ($streamMode == "mpeg") {
    outputVideoStream("liveStream", $streamSrc, reScale($monitor['Width'], $scale), reScale($monitor['Height'], $scale), ZM_MPEG_LIVE_FORMAT, validHtmlStr($monitor['Name']));
} elseif ($streamMode == "jpeg") {
    if (canStreamNative()) {
        outputImageStream("liveStream", $streamSrc, reScale($monitor['Width'], $scale), reScale($monitor['Height'], $scale), validHtmlStr($monitor['Name']));
    } elseif (canStreamApplet()) {
        outputHelperStream("liveStream", $streamSrc, reScale($monitor['Width'], $scale), reScale($monitor['Height'], $scale), validHtmlStr($monitor['Name']));
    }
} else {
    outputImageStill("liveStream", $streamSrc, reScale($monitor['Width'], $scale), reScale($monitor['Height'], $scale), validHtmlStr($monitor['Name']));
}
?>
      </div>
    </div>
  </div>
</body>
</html>
开发者ID:moeiscool,项目名称:ZoneMinder-video,代码行数:30,代码来源:cycle.php

示例3: getStreamHTML

function getStreamHTML($monitor, $scale = 100)
{
    //FIXME, the width and height of the image need to be scaled.
    if (ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT) {
        $streamSrc = $monitor->getStreamSrc(array("mode=mpeg", "scale=" . $scale, "bitrate=" . ZM_WEB_VIDEO_BITRATE, "maxfps=" . ZM_WEB_VIDEO_MAXFPS, "format=" . ZM_MPEG_LIVE_FORMAT));
        outputVideoStream("liveStream", $streamSrc, reScale($monitor->Width(), $scale), reScale($monitor->Height(), $scale), ZM_MPEG_LIVE_FORMAT, $monitor->Name());
    } else {
        if (canStream()) {
            $streamSrc = $monitor->getStreamSrc(array('mode=jpeg', 'scale=' . $scale, 'maxfps=' . ZM_WEB_VIDEO_MAXFPS, 'buffer=' . $monitor->StreamReplayBuffer()));
            if (canStreamNative()) {
                outputImageStream("liveStream", $streamSrc, reScale($monitor->Width(), $scale), reScale($monitor->Height(), $scale), $monitor->Name());
            } elseif (canStreamApplet()) {
                outputHelperStream("liveStream", $streamSrc, reScale($monitor->Width(), $scale), reScale($monitor->Height(), $scale), $monitor->Name());
            }
        } else {
            $streamSrc = $monitor->getStreamSrc(array('mode=single', "scale=" . $scale));
            outputImageStill("liveStream", $streamSrc, reScale($monitor->Width(), $scale), reScale($monitor->Height(), $scale), $monitor->Name());
            Info("The system has fallen back to single jpeg mode for streaming. Consider enabling Cambozola or upgrading the client browser.");
        }
    }
}
开发者ID:schrorg,项目名称:ZoneMinder,代码行数:21,代码来源:functions.php

示例4: canEdit

;
var eventsRefreshTimeout = <?php 
echo 1000 * ZM_WEB_REFRESH_EVENTS;
?>
;
var imageRefreshTimeout = <?php 
echo 1000 * ZM_WEB_REFRESH_IMAGE;
?>
;

var canEditMonitors = <?php 
echo canEdit('Monitors') ? 'true' : 'false';
?>
;
var canStreamNative = <?php 
echo canStreamNative() ? 'true' : 'false';
?>
;

var canPlayPauseAudio = Browser.ie;

<?php 
if ($monitor['CanMoveMap']) {
    ?>
var imageControlMode = "moveMap";
<?php 
} elseif ($monitor['CanMoveRel']) {
    ?>
var imageControlMode = "movePseudoMap";
<?php 
} elseif ($monitor['CanMoveCon']) {
开发者ID:moeiscool,项目名称:ZoneMinder-video,代码行数:31,代码来源:watch.js.php

示例5: canStream

function canStream()
{
    return canStreamNative() | canStreamApplet();
}
开发者ID:rodoviario,项目名称:ZoneMinder,代码行数:4,代码来源:functions.php

示例6: displayMonitor

function displayMonitor($monitor, $bandwidth)
{
    if (!defined(ZM_WEB_DEFAULT_SCALE)) {
        $scale = 40;
    } else {
        $scale = ZM_WEB_DEFAULT_SCALE;
    }
    if (ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT) {
        $streamMode = "mpeg";
        $streamSrc = getStreamSrc(array("mode=" . $streamMode, "monitor=" . $monitor['Id'], "scale=" . $scale, "bitrate=" . ZM_WEB_VIDEO_BITRATE, "maxfps=" . ZM_WEB_VIDEO_MAXFPS, "format=" . ZM_MPEG_LIVE_FORMAT, "buffer=" . $monitor['StreamReplayBuffer']));
    } elseif (canStream()) {
        $streamMode = "jpeg";
        $streamSrc = getStreamSrc(array("mode=" . $streamMode, "monitor=" . $monitor['Id'], "scale=" . $scale, "maxfps=" . ZM_WEB_VIDEO_MAXFPS, "buffer=" . $monitor['StreamReplayBuffer']));
    } else {
        $streamMode = "single";
        $streamSrc = getStreamSrc(array("mode=" . $streamMode, "monitor=" . $monitor['Id'], "scale=" . $scale));
    }
    $width = $monitor['Width'] * ('.' . $scale) + 20;
    $display_name = strlen($monitor['Name']) > 10 ? substr($monitor['Name'], 0, 10) . '...' : $monitor['Name'];
    ?>
	<li id="monitor_<?php 
    echo $monitor['Id'];
    ?>
" style="width:<?php 
    echo $width;
    ?>
px;">
		<div class="mon_header">
			<div style="float:left;overflow:hidden;width:100px;"><h3 style="display:inline;"><?php 
    echo $display_name;
    ?>
</h3></div>
			<div class="right">
				<div class="spinner"></div>
				<div class="minimize"><img src="skins/modern/graphics/minimize.png" style="width:15px;" alt="minimize" /></div>
				<div class="maximize" url="?view=watch&amp;mid=<?php 
    echo $monitor['Id'];
    ?>
"><img src="skins/modern/graphics/maximize.png" style="width:15px;" alt="maximize" /></div>


			</div>
			<br style="clear:both;" />
		</div>
		<div class="mon">
			<a rel="monitor" href="?view=watch&amp;mid=<?php 
    echo $monitor['Id'];
    ?>
" title="<?php 
    echo $monitor['Name'];
    ?>
">
			<?php 
    //$name = $monitor['Name'] . "_live";
    //outputImageStill( "$name", $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), $monitor['Name'] );
    // output image
    if ($streamMode === "mpeg") {
        outputVideoStream('liveStream' . $monitor['Id'], $streamSrc, reScale($monitor['Width'], $scale), reScale($monitor['Height'], $scale), ZM_MPEG_LIVE_FORMAT, $monitor['Name']);
    } elseif ($streamMode == "jpeg") {
        if (canStreamNative()) {
            outputImageStream('liveStream' . $monitor['Id'], $streamSrc, reScale($monitor['Width'], $scale), reScale($monitor['Height'], $scale), $monitor['Name']);
        } elseif (canStreamApplet()) {
            outputHelperStream('liveStream' . $monitor['Id'], $streamSrc, reScale($monitor['Width'], $scale), reScale($monitor['Height'], $scale), $monitor['Name']);
        }
    } else {
        outputImageStill('liveStream' . $monitor['Id'], $streamSrc, reScale($monitor['Width'], $scale), reScale($monitor['Height'], $scale), $monitor['Name']);
    }
    ?>
			</a>
		</div>
		<div class="monfooter"></div>
</li>
<?php 
}
开发者ID:mondychan,项目名称:modern,代码行数:74,代码来源:monitors.php


注:本文中的canStreamNative函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。