Comments (15)
I tried to integrate the streaming part to my video library and the logic also works for video streaming.
from persistentstreamplayer.
Awesome @brianhei. I haven't had a chance to integrate PersistentStreamPlayer. Still on my roadmap though.
from persistentstreamplayer.
@ankushdhawan it should work, yes. I haven't tested in yet in production though. Let me know how it goes for you and if there are any problems we can fix them — the goal of the library is to support audio and video, and AVPlayer should handle both agnostically.
from persistentstreamplayer.
from persistentstreamplayer.
@ankushdhawan please be more specific about your issue. "its not work" doesn't help me investigate.
from persistentstreamplayer.
@ankushdhawan it's possible we may be using this library for video at @calm in our next version, in which case I'll be robustly testing the functionality before that. in either case, a pull request is welcomed if you're able to fix your issue (almost certainly easier than starting from scratch)
from persistentstreamplayer.
video is not showing only sound is working.
from persistentstreamplayer.
OK I have a few questions:
(1) what is the video format?
(2) have you logged the bits coming in (or just their lengths) and compared with the video file itself?
(3) are there any print statements in your Xcode debug console?
If you can paste a code sample and the video asset's URL I'm happy to investigate further.
from persistentstreamplayer.
let tempPath = NSURL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent((videoModel?.video_url)!)
var remoteAudioPlayer = PersistentStreamPlayer(remoteURL:url, localURL: tempPath!)
remoteAudioPlayer?.delegate = self;
remoteAudioPlayer?.addSubView(videoView)
remoteAudioPlayer?.play()
- addSubView function i have create in your library
-(void)addSubView:(UIView *)parent
{
_playerViewController.view.frame = parent.frame;
_playerViewController.videoGravity = AVLayerVideoGravityResizeAspectFill;
[parent addSubview:_playerViewController.view];
}
- (void)prepareToPlay
{
self.pendingRequests = [NSMutableArray array];
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:self.audioRemoteStreamingURL options:nil];
[asset.resourceLoader setDelegate:self queue:dispatch_get_main_queue()];
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset automaticallyLoadedAssetKeys:@[@"duration"]];
self.player = [[AVPlayer alloc] initWithPlayerItem:playerItem];
[self.player.currentItem addObserver:self
forKeyPath:@"status"
options:NSKeyValueObservingOptionNew
context:NULL];
_playerViewController.player = self.player;
}
from persistentstreamplayer.
@tsheaff I've been looking for a cached video stream solution for AVPlayer. I'll try out your library and see if I can get it working with video.
from persistentstreamplayer.
@adenisonafifi cheers, much appreciated. As I mentioned, most of the hard work w/r/t streaming to disk and the buffer should be handled, it may be quite easy to get it working (although I'm not positive)
from persistentstreamplayer.
It doesn't look like the AVURLAsset loads from the local file if it already exists. Is that true? I would want to avoid re-streaming the asset if it has already been saved.
from persistentstreamplayer.
Yes that's a good point. That would be a nice addition, and shouldn't break anything for anyone. I was initializing AVAudioPlayer
instead of a PersistentStreamPlayer
when the file is present, but it makes sense to handle that functionality inside the library.
Another wrinkle is looping, right now looping is particular to audio with
@property (nonatomic, strong) AVAudioPlayer *loopingLocalAudioPlayer;
instead of a generic AVPlayer.
Not critical for v0 of video support though.
from persistentstreamplayer.
please check cstlex#1 for streaming from the local filesystem if available.
from persistentstreamplayer.
@ankushdhawan can you help me for video playing using this third party?
from persistentstreamplayer.
Related Issues (7)
- readyToPlay events fires only once video is down loading entirely HOT 4
- Implement seekToTime that guarantees that the bits save to the disk in the proper order
- Stop or Play Next HOT 5
- crashes if device runs out of space while streaming to disk
- Player starts randomly when Screen is locked HOT 2
- Not working with endless streams (radio streams)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from persistentstreamplayer.