Anti-leech of WMP parameters on the page

Source: Internet
Author: User

An example found: this dynamic page dynamically generates Asx and then plays the mediaplayer.
<% @ Page Language = "Java" contenttype = "Video/X-MS-ASF; charset = gb2312" %>
<%
// The directory where the music file is located. I use an absolute path here and I am free to use it.
String songid = (string) request. getattribute ("songid ");
/* Multiple music files transmitted from the servlet are connected "_"
Then use the split ("") method of the string class to split the string into an array and loop the string array.
Writing to ASX mark */
String [] STR = songid. Split ("_");
%>
<ASX version = "3.0">
<%
For (INT I = 0; I <Str. length; I ++)
{
/* My site music file and JSP Program Not on one server
No extension is added when the file is entered into the database, so I add ". wma" below, and I am free to add it.
*/
STR [I] = STR [I] + ". wma ";
%>
<Entry>
<Author> </author>
<Copyright> low-quality music, for auditions only! Please support genuine albums! </Copyright>
<Title> </title>
<Param name = "WM/albumtitle" value = "Love Dragon♂Space [www.ilkj.net] "/>
<Ref href = "<% = URL + STR [I] %>"/>
</Entry>
<%
}
%>
</ASX>

Request. getattribute ("songid"); dynamically generated by the background. In this case, you can perform random code operations to prevent leeching.

On the other hand, plug-ins are implemented on the Windows Media Server in a mode similar to the following:
<Object ID = "mplayer1" Height = "60" width = "300" classid = "CLSID: 6bf52a52-394a-11d3-b153-00c04f79faa6" class = "Player">
<Param name = 'url' value = "MMS: // 60.190.28.152/vod1/VOD/SMM/film03123001.wmv? 00d2752d19d3b7c04b20d4364b061c94 ">
<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 = "100">
<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 = "0">
<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 = "8123">
<Param name = "_ CY" value = "1588">
</Object>
Or when the ASX is dynamically generated, add the random parameters in the URL.
Then the server plug-in gets the random code for comparison. If the comparison is incorrect, the player is rejected.

the test result is feasible. Write the authorization plug-in on the server and verify the random check code through the authorization plug-in to control that the audio/video can only be played on a specific webpage.
that is,
open the webpage-> verify that the server generates a Random verification code-> write the Random verification code to the client player parameters on the page-> the Streaming Media Server authorization plug-in obtains the Random verification code transmitted by the client player-> compare the authorization plug-in with the verification server's random code-> confirm that the random code is correct, it is played. Otherwise, it is not played. Set a shorter expiration time, for example, 1 minute.
In addition, in order to control a single account, you can only view it by yourself. You cannot view multiple users with one account at the same time. The client page and heartbeat server can be used for Heartbeat Control by using a method similar to QQ kicker. Only one user can watch videos under one account.

Related Article

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.