From 89d62d03f0b7903577219fc0fa9c7763845b3e2a Mon Sep 17 00:00:00 2001 From: Timothy Shamilov Date: Mon, 2 Jul 2018 16:43:22 -0400 Subject: [PATCH] (ios): rm audio overlay on vid view (#142) increment version --- package.json | 2 +- plugin.xml | 2 +- src/ios/StreamingMedia.m | 16 ++++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index cab6a79..4f229e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-streaming-media", - "version": "2.1.1", + "version": "2.1.2", "description": "This plugin allows you to stream audio and video in a fullscreen, native player on iOS and Android.", "main": "index.js", "scripts": { diff --git a/plugin.xml b/plugin.xml index 6cc6ebc..540f48b 100755 --- a/plugin.xml +++ b/plugin.xml @@ -3,7 +3,7 @@ xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-streaming-media" - version="2.1.1"> + version="2.1.2"> StreamingMedia diff --git a/src/ios/StreamingMedia.m b/src/ios/StreamingMedia.m index bed42fa..b41a4c0 100755 --- a/src/ios/StreamingMedia.m +++ b/src/ios/StreamingMedia.m @@ -24,6 +24,7 @@ @implementation StreamingMedia { UIImageView *imageView; BOOL initFullscreen; NSString *mOrientation; + NSString *videoType; } NSString * const TYPE_VIDEO = @"VIDEO"; @@ -52,6 +53,8 @@ -(void)parseOptions:(NSDictionary *)options type:(NSString *) type { } if ([type isEqualToString:TYPE_AUDIO]) { + videoType = TYPE_AUDIO; + // bgImage // bgImageScale if (![options isKindOfClass:[NSNull class]] && [options objectForKey:@"bgImage"]) { @@ -214,13 +217,14 @@ -(void)startPlayer:(NSString*)uri { name:AVPlayerItemFailedToPlayToEndTimeNotification object:moviePlayer.player.currentItem]; - - if (imageView != nil) { - [moviePlayer.contentOverlayView setAutoresizesSubviews:YES]; - [moviePlayer.contentOverlayView addSubview:imageView]; + if ([videoType isEqualToString:TYPE_AUDIO]) { + if (imageView != nil) { + [moviePlayer.contentOverlayView setAutoresizesSubviews:YES]; + [moviePlayer.contentOverlayView addSubview:imageView]; + } + moviePlayer.contentOverlayView.backgroundColor = backgroundColor; + [self.viewController.view addSubview:moviePlayer.view]; } - moviePlayer.contentOverlayView.backgroundColor = backgroundColor; - [self.viewController.view addSubview:moviePlayer.view]; // Listen for click on the "Done" button