黑莓中通过 http 进行视频流传输

发布于 2024-09-04 19:02:17 字数 1777 浏览 2 评论 0原文

当我通过 http 搜索视频播放器时,我发现了位于此 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

我可以通过在末尾添加“;deviceside=true”来运行网址。在jde4.5模拟器中运行良好。它从我的本地服务器获取 3gp 视频。我用 580kb 文件进行了测试,工作正常。但是当我从我的服务器(不是本地的真实服务器)获取相同的文件时,我遇到了大文件(例如 580 kb)的问题。它播放 180kb 文件(但有时它也不播放该文件),但不播放 580kb 文件。而且我将应用程序部署到我的 9000 设备上,它有时播放小文件(180kb),但从不播放大文件(580kb)。

为什么它在我的本地文件中播放,而不是在现实世界中播放?

我已经困了好几天了。希望你能帮助我。

而且下面给出的 url 处的代码也不起作用,我找到的唯一代码就是上面的代码。

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

顺便说一句,没有 CircularByteBuffer 的 resize(long param) 等方法班级。所以我评论相关行 (buffer.resize(buffer.getSize() + (buffer.getSize() * percent / 100)); 如下所示。

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();
                }
            }
        }
    }
}

提前致谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小梨窩很甜 2024-09-11 19:02:17

通过在 URL 上使用“;deviceside=true”,您将告诉设备使用 Direct TCP 传输进行连接。在 CDMA 设备(和模拟器)上,这可以正常工作,但在 GSM 设备上,您需要指定 APN。它可能已经在设备设置中配置(在“选项”->“TCP”下),但通常情况下,它没有配置。在这种情况下,您需要按照 这篇知识库文章

不幸的是,如果您计划支持多个运营商,尝试为所有运营商获取正确的 APN 可能会很乏味(而且是一场支持噩梦)。在这种情况下,您可能需要使用 BIS 传输,这会使事情变得更容易,因为没有 APN。但是,您需要加入 RIM 的联盟计划才能访问 BIS。

有关网络传输的更多信息,请参阅 此知识库文章

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文