2013 m. sausio 27 d., sekmadienis

Windows Media Files to Web page

1. Naudojame object.

Playlist.aspx?ID=142 - failas, kuriame sudėtas video sąrašas

< object id="Player" width="900" height="700" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-mplayer2" >
< param name="FileName" value="Playlist.aspx?ID=142" >
< param name="autostart" value="true" >
</ object >

2. ASX failo struktūra, sudaranti video sąrašą:

< asx version="3.0" >


< TITLE > Playlist </ TITLE >

< ENTRY >

< TITLE >pavadinimas< /TITLE >

< REF HREF=http://serveris/pavadinimas.wmv />

</ ENTRY >

< ENTRY >

< TITLE >naudojami-komponentai</ TITLE >

< REF HREF=http://serveris/pavadinimas2.wmv />

</ ENTRY >
</ asx >

3. Javascript  

SetCurrentEntry - pakeičia dabar grojantį video į nurodytą
getCurrentEntry - rodo dabar grojančio video numerį  

function managePlaylist(orderID) {
if (document.getElementById('Player').getCurrentEntry() == 1) {

try {

document.getElementById('Player').contentDocument.Play();

} catch (err) { }
}


try {
document.getElementById('Player').contentDocument.SetCurrentEntry(orderID);
}
catch (err) {
}

}


 function StartMeUp() {
            document.getElementById('Player').contentDocument.autostart = "true";
            document.getElementById('Player').contentDocument.Enabled = "true";
            document.getElementById('Player').contentDocument.Play();
 }

 function ShutMeDown() {
     document.getElementById('Player').contentDocument.Enabled = "false";
 }

Daugiau:
http://msdn.microsoft.com/en-us/library/ms983653.aspx
http://www.microsoft.com/windows/windowsmedia/howto/articles/adsolutions2.aspx#creatingtheannouncementfile


Dėl mp4 formato palaikymo Windows Media Player'yje: pageidaujamas formatas yra .wmv, nors Windows Media Player 12 palaiko ir mp4 formatą.


Media Player 12 yra tik nuo Windows 7, Windows XP - palaiko tik Windows Media Player 11.

http://support.microsoft.com/kb/316992 - Windows Media Player formatų palaikymas

2013 m. sausio 22 d., antradienis

User.Identity.Name in User Control

HttpContext.Current.User.Identity.Name - dažniausiai WebService'uose

Page.User.Identity.Name - UserControl'suose

2013 m. sausio 10 d., ketvirtadienis

JavaScript IE vs JavaScript Chrome

IE works:

function validateMax2500Len(source, args) {


var x = (document.getElementById("txtDesc").value);

var l = document.getElementById("txtDesc").lastChild.length;

document.getElementById("lblLength").innerText = l;

if (x != "") {

if (l <= 100) { args.IsValid = true; }

else { args.IsValid = false; }

};

};   Chrome works:   function validateMax2500Len(source, args) {

var x = (document.getElementById("txtDesc").value);

var l = document.getElementById("txtDesc").value.length;

document.getElementById("lblLength").innerText = l;

if (x != "") {

if (l <= 100) { args.IsValid = true; }

else { args.IsValid = false; }

};

};