WMP-based video playback. net Video Playback

Source: Internet
Author: User
Today, FAN asked me if online videos are difficult to handle. I heard a classmate say this before. It seems that it is not difficult, so I plan to watch it myself.
However, because a website customer who has been N years ago wants to add a feature, Fan's friend, even if he is not happy to do so, he should start working immediately.
I changed the website N long ago, so I felt too unfamiliar. I changed it for more than two hours. In addition, I didn't eat any nutrients in the morning, so I soon lost my strength,
However, in the final analysis, it is quite painful to change the website, especially to involve databases ...... No patience after the change. I don't want to study it at all.
I watched the video, but I continued to watch it with my scalp. But I didn't see any name hall. I went on in the afternoon. Fortunately, I learned it. Paste the code first.
<Script type = "text/javascript">
Function player (id, title ){
Var titlebt = document. getElementById ('bt ');
Titlebt. value = 'video: '+ title;
Var vid = document. getElementById ('mplayer1 ');
Vid. autoStart = '0'
Vid. URL = 'upfiles/'+ id;
Vid. autoStart = '1'
}
</Script>
Just now, I secretly dumped the water from the cup of Wang Jie, but I don't want to pick it up. Wang Jie is so derogatory that he even gave it to me ......
In fact, I am afraid to pick up the boss, but I am afraid of him.
Continue code:
<Object id = "mPlayer1" width = '000000' height = '000000' classid = "CLSID: 6BF52A52-394A-11D3-B153-00C04F79FAA6">
<Param name = "URL" value = "upfiles/2.wmv">
<Param name = "rate" value = "1">
<Param name = "balance" value = "0">
<Param name = "currentPosition" value = "0">
<Param name = "defaultFrame" value>
<Param name = "playCount" value = "100">
<Param name = "autoStart" value = "1">
<Param name = "currentMarker" value = "0">
<Param name = "invokeURLs" value = "1">
<Param name = "baseURL" value>
<Param name = "volume" value = "20">
<Param name = "mute" value = "0">
<Param name = "uiMode" value = "full">
<Param name = "stretchToFit" value = "0">
<Param name = "windowlessVideo" value = "0">
<Param name = "enabled" value = "1">
<Param name = "enableContextMenu" value = "1">
<Param name = "fullScreen" value = "0">
<Param name = "SAMIStyle" value>
<Param name = "SAMILang" value>
<Param name = "SAMIFilename" value>
<Param name = "captioningID" value>
<Param name = "enableErrorDialogs" value = "0">
<Param name = "_ cx" value = "7779">
<Param name = "_ cy" value = "1693">
</Object>
<Br/>
<Input id = "bt" type = "text" readonly = "readonly" runat = "server" value = ""/>

<Asp: Repeater ID = "Repeater1" runat = "server">
<ItemTemplate>
<A href = "#" onclick = "player ('<% # DataBinder. eval (Container. dataItem, "Name") %> ',' <% # DataBinder. eval (Container. dataItem, "Name") %> ') "> <% # Eval (" Details ") %> </a>

</ItemTemplate>
</Asp: Repeater>
This is based on WMP, so it is relatively simple. This is what a friend told me. I didn't know what WMP was at the beginning. Baidu actually did.
Windows media player.
I gave an example from the beginning, but after I used it directly, I found that the video could not be played. After I ruled out that Chinese character encoding is not supported, I thought it would be
I uploaded an error message from my address, and then carefully checked the lower value. I found that this id parameter in player in js is incorrect,
Onclick = "player ('<% # DataBinder. eval (Container. dataItem, "Name") %> ',' <% # DataBinder. eval (Container. dataItem, "Name") %> ') "> <% # Eval (" Details ") %> </a>
After reading the error message, it should be the name of the video, but I uploaded it as an ID. Therefore, after modification, it is still not possible. Continue to find the error,
<Param name = "URL" value = "upfiles/2.wmv"> the path is complete. URL = id; the path is not changed to vid. URL = 'upfiles/'+ id;
OK. It runs well. When the webpage is closed, it always gets stuck. I don't know why ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.