Deletes a specified media file on player.

Source: Internet
Author: User
   # Region  Disk space management: deletes a specified media file on the player.  

Public Void Commandsetmanagedisk ( Byte GID, Byte Did, String Deletestring)
{
// Packet forwarding
String Managediskstr = Deletestring;
Byte I = 0 ;
Encoding gb2312encoding = Unicodeencoding. getencoding ( " Gb2312 " );
Byte [] Managedisk = Gb2312encoding. getbytes (managediskstr );
Byte [] Mymanagedisk = New Byte [ 300 ];
Int Txtlength = Managedisk. length;

Int Packetizationtimer = Txtlength / 300 ;
Int Packetizationresidue = Txtlength % 300 ;
Int Packetizationsender;
// If there is no remainder, you do not need to send more packets once.
If (Packetizationresidue > 0 )
{
Packetizationsender = Packetizationtimer + 1 ;
}
Else
{
Packetizationsender = Packetizationtimer;
}
// Start Subcontracting
For (I = 0 ; I < Packetizationsender; I ++ )
{
If (I < Packetizationtimer)
{
Array. Copy (managedisk, I * 300 , Mymanagedisk, 0 , 300 );
}
Else
{
Array. Copy (managedisk, I * 300 , Mymanagedisk, 0 , Packetizationresidue );
}

Playermessages. setmanagedisk = New Playermessages. setmanagedisk ();
Setmanagedisk. Direct = 0x02 ;
Setmanagedisk. Category = 0x03 ;
Setmanagedisk. Type = 0x10 ;

Setmanagedisk. groupid = GID;
Setmanagedisk. DeviceID = Did;
Setmanagedisk. Sequence = I;
Setmanagedisk. Size = 300 ;
If (I = (Packetizationsender - 1 )){

Setmanagedisk. Sequence = 0xff ;
Setmanagedisk. Size = ( Ushort ) Packetizationresidue;

}

Setmanagedisk. deletefile = Mymanagedisk;

Byte [] Data = Playermessages. structtobytes (setmanagedisk );
Ssock. onudpdatasend (data );
}
}


Playermessages. setmanagedisk is a struct, UDP Packet Data Structure
Setmanagedisk. Sequence = I; indicates the number of the package, and 0xff indicates the last package

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.