Symbian 播放器:關於CVideoPlayerUtility::OpenUrlL()播放rtsp檔案

來源:互聯網
上載者:User

實踐證明運用CVideoPlayerUtility::OpenUrlL()是可以播放rtsp的流檔案的。主要參考S60_Platform_Video_Example_v2_0_en.zip

把裡面的CVideoPlayerAdapter::InitControllerL方法中的OpenFileL改成OpenUrlL(url),就可以了;

如:

CVideoPlayerUtility *iPlayer = CVideoPlayerUtility::NewL(*this, EMdaPriorityNormal,
                                            EMdaPriorityPreferenceNone, aWs,
                                            aScreenDevice,aWindow,aScreenRect,
                                            aClipRect);

 TBuf <128> urlBuf;
 urlBuf.Copy(_L("rtsp://stream.zoovision.com/musicvideos/well_make_a_lover_of_you.3gp"));
 //TRAPD(unsupported, iPlayer->OpenFileL(iMediaFile->Des()));
 HBufC* tmpHBuf = HBufC::NewLC(urlBuf.Length());
 TPtr  ptr(tmpHBuf->Des());
 ptr.Copy(urlBuf);
 TRAPD(unsupported, iPlayer->OpenUrlL(tmpHBuf->Des())); 
 CleanupStack::Pop(tmpHBuf);

 

如果安裝到真機上還不能播放,可能跟mmp的能力有關,在mmp->option選項裡選擇capability,我選擇了

LocalServices UserEnvironment ReadUserData WriteUserData NetworkServices

 

或者直接在mmp檔案中加上:

CAPABILITY    LocalServices UserEnvironment ReadUserData WriteUserData NetworkServices

 

打包,簽名,安裝,運行,ok,我在3rd版本的真機上(模擬器沒搞定,可能是網路設定沒設對,不管了)和3rd_fp2版本的模擬器上都正常播放了。

 

額外話題:今天安裝改項目sis時突然出現“未授予所需的程式接入許可權”,開始以為是認證到期,但簽名其他項目還是好的,左思右想,原來是一開始選擇capability的時候全部都選了,結構可想而知了,當然不行了,修改成以上的capability後,再刪除sdk下該項目相關的檔案,重新編譯,打包,簽名,ok,全部搞定。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.