Giter VIP home page Giter VIP logo

xjavplayer's Issues

为什么我的横屏只是播放器被拉大了,并没有真正的横屏

循环引用导致内存泄漏

    self.bottomMenu.xjFullOrSmallBlock = ^(BOOL isFull){
        
        _isallFull = isFull;
        
        NSLog(@"全屏---%u",isFull);
        
        if (isFull) {
            [UIDevice setOrientation:UIInterfaceOrientationLandscapeRight];
            weakSelf.frame = weakSelf.window.bounds;
        }else{
            [UIDevice setOrientation:UIInterfaceOrientationPortrait];
            weakSelf.frame = weakSelf.firstFrame;
        }
    };
- (void)xjTopMenuBlock{
    WS(weakSelf);
    //返回
    self.topMenu.xjTopGoBack = ^{
        _isallFull = NO;
        if (weakSelf.bottomMenu.xjFull) {
            [UIDevice setOrientation:UIInterfaceOrientationPortrait];
            weakSelf.frame = weakSelf.firstFrame;
            weakSelf.bottomMenu.xjFull = NO;
        }else{
            if ([weakSelf.XjAVPlayerSDKDelegate respondsToSelector:@selector(xjGoBack)]) {
                [weakSelf.XjAVPlayerSDKDelegate xjGoBack];
            }
        }
    };
}

_isallFull要用弱引用,这样直接使用会对self造成强引用导致循环引用

kvo

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7f8732e86e60 of class AVPlayerItem was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x7f8735377200> (
<NSKeyValueObservance 0x7f87352a4160: Observer: 0x7f873536ad80, Key path: status, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x7f87352a3c20>
<NSKeyValueObservance 0x7f87352a4280: Observer: 0x7f873536ad80, Key path: loadedTimeRanges, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x7f87352a41c0>
)'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.