如何使用Monotouch在iPhone中播放MJPEG流?使用Monotouch在iPhone中播放MJPEG流
首先我使用webview來玩。在iOS 5中,它正在播放,但在iOS 6和更高版本的MJPEG中沒有在webview中播放。
我在XCode中找到Motion JPEG Image視圖。
https://github.com/mateagar/Motion-JPEG-Image-View-for-iOS
我嘗試運動JPEG圖像以MonoTouch的C#轉換,但我不能。
如何使用Monotouch在iPhone中播放MJPEG流?使用Monotouch在iPhone中播放MJPEG流
首先我使用webview來玩。在iOS 5中,它正在播放,但在iOS 6和更高版本的MJPEG中沒有在webview中播放。
我在XCode中找到Motion JPEG Image視圖。
https://github.com/mateagar/Motion-JPEG-Image-View-for-iOS
我嘗試運動JPEG圖像以MonoTouch的C#轉換,但我不能。
您是否嘗試過使用MPMoviePlayerViewController
? Apple文檔here。
我們用它來播放this app的本地視頻文件,效果很好。
使用方法如下,請確保它是「視圖控制器」,而不是「控制器」:
var movieController = new MPMoviePlayerController(new NSUrl("http://yoururl.com/yourmovie.mp4"));
movieController.MoviePlayer.ShouldAutoplay = true;
movieController.MoviePlayer.SourceType = MPMovieSourceType.Streaming;
//Show the controller modally over top another controller
PresentViewController(movieController, true, null);
使用MJPEGClient它可以播放MJPEG視頻與插座。我已經實施了提及以下示例MJPEG 如果有任何問題回覆給我。
感謝回覆@Jonathanpeppers。我嘗試MPMoviePlayerViewController但沒有成功。不播放本地視頻文件。我從在線播放直播視頻或錄製視頻MJEPG格式...在Xcode中有一個自定義控件,用於在線播放MJPEG格式,但不是在Monotouch中播放 – Ramesh 2013-02-28 04:53:27
您可以將任何'NSUrl'傳遞給控制器的構造函數,所以這可能是網站上的網址。這不適合你嗎?如果遇到問題,我可以更新一個示例。 – jonathanpeppers 2013-02-28 13:23:28
我嘗試這個但不玩,我只看到一個黑屏 _moviePlayer = new MPMoviePlayerController(new NSUrl(「URL」)); _moviePlayer.View .Frame = new RectangleF(100f,20f,240f,180f); this.View .AddSubview(_moviePlayer.View); _moviePlayer.Play(); – Ramesh 2013-02-28 14:04:39