Code Monkey home page Code Monkey logo

mux-stats-sdk-avplayer's Introduction

mux-stats-sdk-avplayer

Mux integration with AVPlayer and AVPlayerLayer for iOS native applications.

This integration is built on top of Mux's core Objective-C library, allowing thinner wrappers for each new player, such as any third-party players that do not use (or expose) an underlying AVPlayer and/or AVPlayerLayer.

Integration Instructions

Full integration instructions can be found here: https://docs.mux.com/docs/avplayer-integration-guide.

Sample apps

  • apps/DemoApp - Objective C demo
  • apps/video-demo - Swift demo
  • apps/TvDemoApp - Apple TV demo
  • apps/MUXSDKStatsExampleSPM - Swift Package Manager demo

mux-stats-sdk-avplayer's People

Contributors

andrewjl-mux avatar bmulligan-kg avatar daytime-em avatar dylanjha avatar englishm-mux avatar james-mux avatar jsanford8 avatar kyle-fox avatar nidhik avatar skidder avatar stephaniezuniga avatar wtao-mux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mux-stats-sdk-avplayer's Issues

Unable to commit Mux SDK to git repository after v2.2.0

Since v2.2.0 (and up to the latest version) I started getting the following error when trying to commit the updated Mux SDK after performing pod update.

fatal: pathspec 'Pods/Mux-Stats-Core/XCFramework/MuxCore.xcframework/ios-arm64_x86_64-maccatalyst/MuxCore.framework/Headers/MUXSDKAdBreakEndEvent.h' is beyond a symbolic link

Context:

  • the Mux SDK is integrated via Cocoapods (pod 'Mux-Stats-AVPlayer') and committed along with the project to our git repository
  • up to v2.2.0 I was able to commit the Mux SDK to the repo after performing pod update but after updating to v2.2.0 I started getting the above error
  • as a temporary workaround I locked the SDK version to v2.1.0 (pod 'Mux-Stats-AVPlayer', '2.1.0') which can be committed but this is not an ideal solution since I cannot updated to the latest version

Crash calling monitorAVPlayerLayer

mux-stats-sdk-avplayer 3.4.1

Calling monitorAVPlayerLayer causes the app to crash for any video. This used to work fine with prior mux versions.

*** First throw call stack:
(0x193aee5e0 0x18be67c00 0x193b7eeec 0x193a337a8 0x193b74860 0x1050184b4 0x1083b851c 0x1083b757c 0x108421e84 0x108418614 0x108421bec 0x1083a17c8 0x1086b53a0 0x1083a17c8 0x195d3d89c 0x1962e01a4 0x195d3d358 0x195d3d184 0x195eb3664 0x195eb331c 0x195c990bc 0x195c98854 0x195c97ecc 0x195c7a498 0x195c7a5ac 0x19506a76c 0x105c0eb34 0x105c1efec 0x105c1eba0 0x193a389bc 0x193a356c8 0x193a34e18 0x1d64f95ec 0x195e432fc 0x195e42938 0x104caf77c 0x1b621fd44)
libc++abi: terminating due to uncaught exception of type NSException```

Carthage support for XCframework

*** Skipped building mux-stats-sdk-avplayer due to the error:
Dependency "mux-stats-sdk-avplayer" has no shared framework schemes for any of the platforms: iOS, tvOS

If you believe this to be an error, please file an issue with the maintainers at https://github.com/muxinc/mux-stats-sdk-avplayer/issues/new

We can't use Carthage with xcframeworks right now, can You add json file to repo for binary support or configure carthage support with xcframework? SPM will be awesome too.

UIWebview still found in mux sdk

Hi there,

We are using mux in our app, the version we are using is 1.3.6, we are receiving warning about the UIWebview when we publish our app to the app store.
pod 'Mux-Stats-AVPlayer', '1.3.6'

After checking the reference of the UIWebview followed by this post (https://levelup.gitconnected.com/how-to-find-and-remove-uiwebview-uses-in-your-ios-app-d9395f7baacc), we found that it seems MUXSDKStats and MuxCore are potentially still using the UIWebview.

for framework in Frameworks/*.framework; do fname=$(basename $framework .framework) echo $fname nm $framework/$fname | grep UIWebView done MUXSDKStats MuxCore

Would you please have a look at this issue? Thanks.

Best regards,
Hai

EXC_BAD_ACCESS Crash v2.13.0

Hi,

We have being using this SDK for several weeks now and our latest build has had two similar crashes come in that we were not seeing previously. These crashes are problematic because they are occurring at the start of video playback. Previously we were using SDK version 2.12.1 and we were not seeing these crashes. It also looks like the release notes for 2.13.0

Deprecate old custom beaconDomain implementation and add new beaconCollectionDomain parameter that does not append the key to the url.

Might be related to the crash since the final line in the stacktrace is -[MUXSDKEventQueue deduplicateBeaconData:].

Here is the stacktrace as it appears in Xcode when viewing the crash:

Screen Shot 2022-05-09 at 14 12 14

Here is the stacktrace we are seeing in BugSnag:

Screen Shot 2022-05-09 at 14 13 00

Crash is reported as

EXC_BAD_ACCESSMUXSDKCoreView
Attempted to dereference garbage pointer 0x12b905e8a590.

and

EXC_BAD_ACCESSMUXSDKViewData
Attempted to dereference garbage pointer 0xdd2d38ec3800

We are seeing this in iOS 15.4.1

For now we will revert to 2.12.1, but please let me know if more information would be helpful ๐Ÿ™

No Support for CocoaPods CDN

It seems as the Mux CocoaPod is not available via the CocoaPods CDN:

Podfile:

require 'fileutils'

#source 'https://cdn.cocoapods.org/'

# Target def etc....
pod 'Mux-Stats-AVPlayer', '~> 1.3.6'

results in:

Analyzing dependencies
[!] Unable to find a specification for `Mux-Stats-AVPlayer (~> 1.3.6)`

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Adding source 'https://github.com/CocoaPods/Specs.git' seems to solve the problem, but this leads to cloning the entire CocoaPods master repo, which is deprecated since CocoaPods 1.8.

Data reported as "[Null Value]" or "[No Value"]

We have been trying to integrate the mux-stats-sdk-avplayer library with our Swift iOS App and are seeing many instances where data in the Mux Data/Metrics dashboards is reported as either [Null Value] or [No Value]

As best we can tell we are following the guidance from: https://docs.mux.com/docs/avplayer-integration-guide

We are using Mux-Stats-AVPlayer version 1.7.0

Here are some snippets of our implementation:

MUXSDKCustomerPlayerData initialisation

    self.avPlayerLayer = avPlayerLayer
    muxPlayerData = MUXSDKCustomerPlayerData(environmentKey: envKey)
    muxPlayerData?.playerVersion = playerVersion
    muxPlayerData?.playerInitTime = NSNumber(value: Date().timeIntervalSince1970)
    muxPlayerData?.playerName = MuxMonitoring.playerName
    muxPlayerData?.viewerUserId = userId

Reporting MUXSDKCustomerVideoData on first item load or changing to a new playback item.

    let muxVideoData = videoData(currentItem: playerItem)

    if muxPlayerBinding == nil {
        muxPlayerBinding = MUXSDKStats.monitorAVPlayerLayer(
            self.avPlayerLayer,
            withPlayerName: MuxMonitoring.playerName,
            playerData: playerData,
            videoData: muxVideoData
        )
    } else {
        MUXSDKStats.videoChange(forPlayer: MuxMonitoring.playerName, with: muxVideoData)
    }

Note our application is playing audio only content using AVPlayer in case that is of any relevance.

The behaviour we are seeing is inconsistent, sometimes the metadata associated with the audio played is reported correctly, but more often then not, every piece of meta data shows as [Null Value] or [No Value].

Are you able to offer any advice or suggestions please?

Integration on YoutubePlayer

Hey!
I was wondering if it is possible to track YouTube videos with this Mux SDK or another one.

Thanks in advance

Migrating from UIWebView to WKWebView

From the docs:

In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView.

Are there any plans to migrate to using WKWebView instead of UIWebView within the framework?

Your dependency GoogleAds-IMA-iOS-SDK also uses UIWebView instead of WKWebView but, as @jsanford8 said here, it shouldn't be a problem since that dependency would be removed.

Thanks!

macOS Catalyst support

We are researching bring our iOS app to macOS via Catalyst. Can we get Catalyst support?

Tear down time observer

Removing the timeObserver from the wrong AVPlayer instance may result in a crash.

Cleanup timeObserver references and add additional checks to guard against this

Pod dependencies broken on Swift example

Hi, when running pod install

Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Mux-Stats-Core":
  In snapshot (Podfile.lock):
    Mux-Stats-Core (= 3.8.0, ~> 3.8)

  In Podfile:
    Mux-Stats-AVPlayer (from `../../`) was resolved to 2.13.0, which depends on
      Mux-Stats-Core (~> 3.12.0)

Hitting a crash when stopping then later using an AVPlayer again

When I added mux data to my app, I immediately started getting crashes which seemed to be related to removing KVO observers:

Screen Shot 2021-04-20 at 8 08 25 PM

This seems to be happening when stop using a player and then later start using it again.

When I start the player, I call monitorAVPlayerLayer():

Screen Shot 2021-04-28 at 3 39 26 PM

When I stop using the player, I call destroyPlayer():

Screen Shot 2021-04-28 at 3 39 34 PM

Perhaps I am using the SDK incorrectly?

Flaky SPM support - getting warnings which can be resolved by running"Clean build folder"

When integrating MUX using SPM building and archiving often fails with

/Users/rist/Library/Developer/Xcode/DerivedData/MUBI-hgzymitxhsmjdicobbmiajmcbaeq/SourcePackages/checkouts/mux-stats-sdk-avplayer/SwiftPM/MUXSDKStats.swift:5:8: error: no such module 'MuxCore'
import MuxCore
       ^

I can resolve that issue usually by running Clean build folder but definitely would feel more confident if this error wouldn't pop up.

Link Error "building for tvOS Simulator-x86_64 but attempting to link with file built for tvOS-arm64"

I just updated the the MUX Pod to the latest version 2.0.0) and adjusted the imports as required.

When building for the Apple TV simulator, I now get this error:

ld: warning: ignoring file /Users/rpittinger/devel/exaring/waipu/Pods/Mux-Stats-AVPlayer/XCFramework/MUXSDKStats.xcframework/tvos-arm64/MUXSDKStats.framework/MUXSDKStats, building for tvOS Simulator-x86_64 but attempting to link with file built for tvOS-arm64
ld: warning: ignoring file /Users/rpittinger/devel/exaring/waipu/Pods/Mux-Stats-Core/XCFramework/MuxCore.xcframework/tvos-arm64/MuxCore.framework/MuxCore, building for tvOS Simulator-x86_64 but attempting to link with file built for tvOS-arm64
ld: warning: Could not find or use auto-linked framework 'Realm'
ld: warning: Could not find or use auto-linked framework 'RealmSwift'
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_MUXSDKCustomerPlayerData", referenced from:
      objc-class-ref in MuxVideoStreamMonitoringService.o
  "_OBJC_CLASS_$_MUXSDKCustomerVideoData", referenced from:
      objc-class-ref in MuxVideoStreamMonitoringService.o
  "_OBJC_CLASS_$_MUXSDKStats", referenced from:
      objc-class-ref in MuxVideoStreamMonitoringService.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have no entries in "Excluded architectures", I am using Xcode 12.2.

Xcode 15 linker warning: Duplicate LC_RPATH are deprecated

Starting with Xcode 15 adding dynamic MUXSDKStats.xcframework 3.3.1 to an iOS project as a dependency causes these linker warning to be emitted, can you please fix?

Duplicate LC_RPATH are deprecated ('@executable_path/Frameworks')
Duplicate LC_RPATH are deprecated ('@loader_path/Frameworks')

FWIW the MuxCore xcframework is fine.
Thanks!

Mux 3.6.0 error with SPM

I tried updating to the latest MUX version today (hopefully with the privacy manifest), but it's failing the fetch call with this error:

Screenshot 2024-04-18 at 9 55 35โ€ฏAM

Unable to integrate via Cocoapods

When adding via cocoapods, I get the following error:

ld: building for iOS, but linking in dylib file (<path>/DerivedData/App/Build/Products/Debug-iphoneos/MUXSDKStats.framework/MUXSDKStats) built for Mac Catalyst, file '/<path>/DerivedData/App/Build/Products/Debug-iphoneos/MUXSDKStats.framework/MUXSDKStats' for architecture arm64

I don't have Mac Catalyst integrated, so I don't know why it's being referenced.

Integration via SPM in shared framework still broken?

The installation instructions at https://docs.mux.com/guides/data/monitor-avplayer#1-install-the-mux-data-sdk state that due to an issue in Swift, MUX needs to be intregrated a .framework if using a shared framework.

However, the links to the corresponding Swift issues do not work anymore, as they are now hosted on Github and registration seems to be disabled anymore.

Is there still no chance to integrate MUX via SPM when using a shared framework?

Crash when using SPM and launching on Mac Catalyst

Hey @gabors, I've created this issue in reference to the crash you reported on Mac Catalyst when installing the SDK using SPM as a dependency to a library target.

I tested an example app on Mac Catalyst with v3.3.2 of the SDK using that installation method without issues.

I suspect the crash happens because the SDK dylib is incorrectly loaded at app launch and not due to a code signing issue. See this Apple DTS post (https://developer.apple.com/forums/thread/695481?answerId=696445022#696445022) about a similar sounding report. That lines up with the crash log you shared with a previous SDK version listing dyld (the process responsible for loading and linking dynamic libraries at runtime) errors in addition to the code signing message. This all makes me curious if the change removing the LC_RPATH warnings also fixed that crash.

If you get a chance to repeat this test with v3.3.2 and still run into issues, we'd be happy to investigate further!

Installation using Carthage doesn't work.

Hi ๐Ÿ‘‹

Short description

I would like to add the MuxStatsSDK to my project using Carthage. I updated my Cartfile following documentation but installation fails when I run the carthage update command.

Env

  • Xcode - Version 13.1
  • macOS - 12.0.1 (Monterey)
  • mux-stats-sdk-avplayer - 2.6.0
  • Carthage - 0.38.0
  • Carthage command:
carthage update --platform iOS,tvOS --use-xcframeworks --no-use-binaries --use-netrc --cache-builds --new-resolver
  • Cartage output (real paths has been hidden behind [PATH]):
*** Building scheme "MUXSDKStatsTv" in MUXSDKStats.xcodeproj
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project [PATH]/Carthage/Checkouts/mux-stats-sdk-avplayer/MUXSDKStats/MUXSDKStats.xcodeproj -scheme MUXSDKStatsTv -configuration Release -derivedDataPath [PATH]/Library/Caches/org.carthage.CarthageKit/DerivedData/13.1_13A1030d/mux-stats-sdk-avplayer/v2.6.0 -sdk appletvos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO -archivePath /var/folders/6q/ytvfydhj50d9jnbk76_zcq580000gp/T/mux-stats-sdk-avplayer SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in [PATH]/Carthage/Checkouts/mux-stats-sdk-avplayer)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6q/ytvfydhj50d9jnbk76_zcq580000gp/T/carthage-xcodebuild.SZZ0wZ.log

Expected behavior

I should be able to install the MuxStatsSDK using the Carthage.

lipo error with Carthage 0.35.0

Hi!

Since upgrading to Carthage 0.35.0, when building (iOS) with against MUXSDKStats for the iOS Simulator, we're getting a lipo error:

A shell task (/usr/bin/xcrun lipo -remove arm64 -output /var/folders/qt/v9_nzmxs0sg0jrhxt3bm_0rr0000gn/T/carthage-lipo-oQRCWc/MUXSDKStats.framework.dSYM/Contents/Resources/DWARF/MUXSDKStats /var/folders/qt/v9_nzmxs0sg0jrhxt3bm_0rr0000gn/T/carthage-lipo-oQRCWc/MUXSDKStats.framework.dSYM/Contents/Resources/DWARF/MUXSDKStats) failed with exit code 1:
fatal error: /Applications/Xcode-11-4-1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: -remove's specified would result in an empty fat file

That particular file /var/folders/qt/v9_nzmxs0sg0jrhxt3bm_0rr0000gn/T/carthage-lipo-oQRCWc/MUXSDKStats.framework.dSYM/Contents/Resources/DWARF/MUXSDKStats only has the arm64 side, which is what's getting removed (since the destination is for the simulator)

/var/folders/qt/v9_nzmxs0sg0jrhxt3bm_0rr0000gn/T/carthage-lipo-oQRCWc/MUXSDKStats.framework.dSYM/Conte\
nts/Resources/DWARF/MUXSDKStats (for architecture arm64): Mach-O 64-bit dSYM companion file arm64

Xcode 11.4.1, Catalina 10.15.5 (19F101). Carthage 0.35.0

And here's a simple project that reproduces the problem (includes the pulled binaries). Or can grab from a repo from here: https://github.com/markd2/Carthage-muxstats (you'll need to run carthage update)

Carthage-muxstats.zip

Thanks!

SPM no such module MUXCore

When i started using MUX SPM it always gives me this issue in every CI/CD Tool i tried while everything else works great and it does works also on Xcode locally idk why it always fails on CI/CD Tools
while when i removed the SPM and used the xcframework for both MUXCore and MUXSDKStat the build succeeds
Can somebody help me identifying wether it's one of SPM MUX lib issues or there's something wrong i have done and there's a specific way of installing the lib to work as it should be ?

Screen Shot 2021-09-09 at 4 53 39 AM
Screen Shot 2021-09-08 at 3 07 33 AM

Repackage SDK to be source based

Tasks

Is it possible to set APPLICATION_EXTENSION_API_ONLY to true?

Hello,

We are using version 2.4 of the SDK for our iOS and tvOS app.

In our current setup, both apps share a dynamic framework that contains our shared video player and MUX bootstrap code next to other things. This dynamic framework is also a dependency for some of our application extensions (a Widget, a Notification Extension, and a Topshelf Provider) and therefore has the setting "Allow app extension API only" enabled.
The framework links against the MUX SDK.

When we build our app we see the following warning:

Linking against a dylib which is not safe for use in application extensions: /...../Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/MUXSDKStats/MUXSDKStats.framework/MUXSDKStats

which seems to be expected as the MUX SDK does not set the APPLICATION_EXTENSION_API_ONLY build setting.

My question would be if there is a reason that the SDK can't be used from a framework that allows app extension API only or if you would consider adding s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' } to both pod specs of the SDK?

Thanks and kind regards,
Markus

Edit: After more research it seems that the missing entry in the pod spec is not the reason for the warning. It seems the precompiled binary in the SDK would need to be compiled with APPLICATION_EXTENSION_API_ONLY = YES to get rid of the warning. Can you please look into this?

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.