video streaming over http in blackberry

2019-05-30 16:31发布

问题:

while i was searching video player over http, i found the article which is located at this url;

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1089414/Stream ing_media_-_Start_to_finish.html?nodeid=2456737&ve rnum=0

i can run by adding ";deviceside=true" at the end of url. it works fine in the jde4.5 simulator. it gets 3gp videos from my local server. i tested with 580kb files and works fine. but when i get the same file from my server (not local, real server) i have problems with big files (e.g 580 kb). it plays 180kb files (but sometimes it does not play this file either) but not plays 580kb file. and also i deployed my application to my 9000 device it sometimes plays small file (180kb) but never plays big file (580kb).

why it plays if it is on my local file, not play in real world?

i ve stucked for days. hope you help me.

and also the code at the url given below is not work, the only code i ve found is the above.

blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1089414/How_To _-_Play_video_within_a_BlackBerry_smartphone_appli cation.html?nodeid=1383173&vernum=0

btw, there is no method such as resize(long param) of CircularByteBuffer class. so i comment relavent line (buffer.resize(buffer.getSize() + (buffer.getSize() * percent / 100)); as shown below.

public void increaseBufferCapacity(int percent) {
    if(percent < 0){
        log(0, "FAILED! SP.setBufferCapacity() - " + percent);
        throw new IllegalArgumentException("Increase factor must be positive..");
    }
    synchronized(readLock){
        synchronized(connectionLock){                
            synchronized(userSeekLock){
                synchronized(mediaIStream){                
                    log(0, "SP.setBufferCapacity() - " + percent);        
                    //buffer.resize(buffer.getSize() + (buffer.getSize() * percent / 100));
                    this.bufferCapacity = buffer.getSize();
                }
            }
        }
    }
}

thanks in advance.

回答1:

By using ";deviceside=true" on your URL you are telling the device to use the Direct TCP transport for your connection. On CDMA devices (and simulators) this will work fine as-is, but on GSM devices you need to specify an APN. It may already be configured in the device settings (under Options->TCP) but more often than not, it is not configured. In this case, you need to add it to the URL as per this KB article.

Unfortunately, if you plan on supporting multiple carriers it can be tedious (and a support nightmare) to try and get the APNs right for all of them. In this case you may want to use the BIS transport, which makes things much easier because there's no APN. However, you'll need to join RIM's Alliance program to get access to BIS.

More information on network transports can be found in this KB article.