本文介绍了如何在文本框中获取(媒体播放器)暂停的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我在asp.net应用程序中播放视频的代码..........如果我暂停视频,请在文本框中获取暂停的时间....
那么如何在文本框中获取暂停时间......
请让我.......
This is my code to play videos in asp.net application..........if i pause the video get the paused time in text box.......
so how to get the paused time in text box.........
pls hlp me.......
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default13.aspx.cs" Inherits="Default13" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
<!--
var WMState = new Array();
WMState[0] = "Undefined";
WMState[1] = "Stopped";
WMState[2] = "Paused";
WMState[3] = "Playing";
WMState[4] = "Scan Forward";
WMState[5] = "Scan Reverse";
WMState[6] = "Buffering";
WMState[7] = "Waiting";
WMState[8] = "Media Ended";
WMState[9] = "Transitioning";
WMState[10] = "Ready";
WMState[11] = "Reconnecting";
function Status ()
{
x = Player.playState;
alert("Windows Media Player is " + WMState[x] + "\r\r" + "Player Version:" + Player.versionInfo);
}
function Play ()
{
x = Player.playState;
if (x == 2) {
Player.controls.play();
}else{
Player.URL = "video.mpeg";
}
}
function Pause ()
{
Player.controls.pause();
}
function Stop () {
Player.controls.stop();
}
-->
</script>
</head>
<body>
<object id="Player" width="320" height="300" type ="video/x-ms-wmv">
<param name = "Volume" value="50"/>
<param name = "AutoStart" value="True"/>
</object>
<br />
<input type="button" name="BtnPlay" value="Play" accesskey="q" onclick="Play()"/>
<input type="button" name="BtnPause" value="Pause" accesskey="w" onclick="Pause()"/>
<input type="button" name="BtnStop" value="Stop" accesskey="s" onclick="Stop()"/>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</body>
</html>
请帮助我.......
pls hlp me.......
推荐答案
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=700,maximum-scale=1.0,user-scalable=yes">
<title>Vimeo Froogaloop API Playground</title>
<style>
body, html, dl, dd { margin: 0; padding: 0;}
body, html {
font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
color: #343434;
background: #f7f7f7;
}
iframe {
display:block;
border:0;
margin-bottom: 20px;
}
h1 {
font-weight: normal;
text-align: center;
}
button {
background: #e9e9e9;
cursor: pointer;
border: 1px solid #ddd;
padding: 2px 13px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
margin: 0;
cursor: pointer;
}
.wrapper {
width: 600px;
margin: 0 auto;
margin-bottom: 30px;
}
.wrapper .container > div {
background: #fff;
padding: 30px;
border: 1px solid #ddd;
box-sizing: border-box;
margin-top: 30px;
}
.wrapper .container:first-child {
margin-top: 0;
}
.wrapper .container h2 {
margin: 0 0 20px 0;
}
.wrapper .container button {
line-height: 19px;
}
.wrapper .container input[type="text"] {
font-size: 12px;
}
button input[type="text"] {
border: 1px solid #ddd;
text-align: center;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
margin: 0 -11px 0 5px;
padding: 2px;
}
.wrapper div dl {
margin-bottom: 15px;
}
.wrapper div dt {
margin-bottom: 5px;
}
.wrapper div dt span {
font-size: 0.9em;
color: #666;
}
.wrapper div dd {
display: inline-block;
font-size: 12px;
margin-bottom: 5px;
}
.wrapper div dd label {
margin-right: 10px;
}
.wrapper div .output {
display: block;
width: 100%;
height: 100px;
border: 1px solid #ddd;
overflow-y: auto;
font-size: 13px;
padding: 5px;
box-sizing: border-box;
line-height: 1.4em;
resize: vertical;
font-family: Inconsolata, Monaco, monospace;
}
.wrapper .container > button {
border: 1px solid #ddd;
font-weight: bold;
font-size: 1.2em;
margin: -1px 0 0 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.wrapper > button input[type="text"] {
padding: 6px;
}
.console dd {
width: 100%;
white-space: nowrap;
}
.console .clear {
margin-top: 10px;
}
</style>
</head>
<body>
<div class="wrapper">
<hgroup>
<h1>Vimeo Froogaloop API Playground</h1>
</hgroup>
<div class="container">
<div>
<h2>Vimeo Player 1</h2>
<iframe id="player_1" src="http://player.vimeo.com/video/7100569?api=1&player_id=player_1" width="540" height="304" frameborder="0"></iframe>
<dl class="simple">
<dt>Simple Buttons <span>(buttons with simple API calls)</span></dt>
<dd><button class="play">Play</button></dd>
<dd><button class="pause">Pause</button></dd>
<dd><button class="unload">Unload</button></dd>
</dl>
<dl class="modifiers">
<dt>Modifier Buttons <span>(buttons that modify the player)</span></dt>
<dd><button class="seek">Seek <input type="text" value="30" size="3" maxlength="3" /></button></dd>
<dd><button class="volume">Volume <input type="text" value="0.5" size="3" maxlength="3" /></button></dd>
<dd><button class="loop">Loop <input type="text" value="0" size="3" maxlength="3" /></button></dd>
<dd><button class="color">Color <input type="text" value="00adef" size="5" /></button></dd>
<dd><button class="randomColor">Random Color</button></dd>
</dl>
<dl class="getters">
<dt>Getters <span>(buttons that get back a value; logged out in the console)</span></dt>
<dd><button class="time">Current Time</button></dd>
<dd><button class="duration">Duration</button></dd>
<dd><button class="color">Color</button></dd>
<dd><button class="url">URL</button></dd>
<dd><button class="embed">Embed Code</button></dd>
<dd><button class="paused">Paused</button></dd>
<dd><button class="getVolume">Volume</button></dd>
<dd><button class="height">Video Height</button></dd>
<dd><button class="width">Video Width</button></dd>
</dl>
<dl class="listeners">
<dt>Event Listeners</dt>
<dd><label><input class="loadProgress" type="checkbox" checked />loadProgress</label></dd>
<dd><label><input class="playProgress" type="checkbox" checked />playProgress</label></dd>
<dd><label><input class="play" type="checkbox" checked />play</label></dd>
<dd><label><input class="pause" type="checkbox" checked />pause</label></dd>
<dd><label><input class="finish" type="checkbox" checked />finish</label></dd>
<dd><label><input class="seek" type="checkbox" checked />seek</label></dd>
</dl>
<dl class="console">
<dt>Console</dt>
<dd><textarea class="output" readonly="readonly"></textarea><button class="clear">Clear</button></dd>
</dl>
</div>
<button class="addClip" title="Add a new clip.">+ <input type="text" value="3718294" size="8" /></button>
</div>
<script src="froogaloop.js"></script>
<script>
(function(){
// Listen for the ready event for any vimeo video players on the page
var vimeoPlayers = document.querySelectorAll('iframe'),
player;
for (var i = 0, length = vimeoPlayers.length; i < length; i++) {
player = vimeoPlayers[i];
这篇关于如何在文本框中获取(媒体播放器)暂停的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!