Skip to content

Commit

Permalink
Merge pull request #1 from ooyala/stable
Browse files Browse the repository at this point in the history
update stable with Latest
  • Loading branch information
skumar2905 authored Apr 18, 2018
2 parents 7af35bc + 590d819 commit e829d80
Show file tree
Hide file tree
Showing 182 changed files with 4,094 additions and 1,401 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ go_script/pkg
.DS_Store
runConfigurations.xml
*.iml
VRSampleApp/app/src/main/assets/data.json
VRSampleAppKotlin/app/src/main/assets/data.json
8 changes: 4 additions & 4 deletions AdvancedPlaybackSampleApp/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
}

task copyTask(type: Copy) {
from new File(vendorDir, 'Ooyala/OoyalaSDK-Android/OoyalaSDK.jar')
from new File(vendorDir, 'Ooyala/OoyalaSDK-Android/OoyalaSDK.aar')
into new File(projectDir, './libs')
doLast {
println "Jars updated."
Expand All @@ -33,11 +33,11 @@ dependencies {
// implementation project(':core')


implementation 'com.google.android.gms:play-services-ads:10.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.0'

implementation 'com.google.android.exoplayer:exoplayer:r2.5.3'
implementation 'com.google.android.exoplayer:exoplayer:2.6.1'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation files('libs/OoyalaSDK.jar')
implementation files('libs/OoyalaSDK.aar')

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.ooyala.android.StateNotifier;
import com.ooyala.android.player.PlayerInterface;
import com.ooyala.android.player.PlayerType;
import com.ooyala.android.player.exoplayer.PlayerBitmapListener;
import com.ooyala.android.plugin.LifeCycleInterface;

public class SampleAdPlayer extends LinearLayout implements PlayerInterface,
Expand Down Expand Up @@ -197,4 +198,14 @@ public void setVolume(float v) {}
public PlayerType getPlayerType() {
return PlayerType.FLAT_PLAYER;
}

@Override
public void createBitmapScreenshot(PlayerBitmapListener playerBitmapListener) {
// TODO
}

@Override
public boolean isMultiAudioAvailable() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,9 @@ public Set<Integer> getCuePointsInMilliSeconds() {
}
return new HashSet<Integer>();
}

@Override
public boolean allADSPlayed() {
return false;
}
}
8 changes: 4 additions & 4 deletions BasicPlaybackSampleApp/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
}

task copyTask(type: Copy) {
from new File(vendorDir, 'Ooyala/OoyalaSDK-Android/OoyalaSDK.jar')
from new File(vendorDir, 'Ooyala/OoyalaSDK-Android/OoyalaSDK.aar')
into new File(projectDir, './libs')
doLast {
println "Jars updated."
Expand All @@ -32,10 +32,10 @@ dependencies {
// For development purposes only
// compile project(':core')

implementation files('libs/OoyalaSDK.jar')
implementation 'com.google.android.exoplayer:exoplayer:r2.5.3'
implementation files('libs/OoyalaSDK.aar')
implementation 'com.google.android.exoplayer:exoplayer:2.6.1'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.android.gms:play-services-ads:10.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.0'

}
2 changes: 1 addition & 1 deletion BasicPlaybackSampleApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ allprojects {

ext {
vendorDir = new File(projectDir, '../vendor')
}
}
3 changes: 3 additions & 0 deletions ChromecastSampleApp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
6 changes: 0 additions & 6 deletions ChromecastSampleApp/README.md

This file was deleted.

17 changes: 8 additions & 9 deletions ChromecastSampleApp/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repositories {
}

task copyTask(type: Copy) {
from new File(vendorDir, 'Ooyala/OoyalaSDK-Android/OoyalaSDK.jar')
from new File(vendorDir, 'Ooyala/OoyalaSDK-Android/OoyalaSDK.aar')
from new File(vendorDir, 'Ooyala/OoyalaCastSDK-Android/OoyalaCastSDK.aar')
into new File(projectDir, './libs')
doLast {
Expand All @@ -41,15 +41,14 @@ dependencies {
// compile project(':cast')
// compile project(':core')

implementation 'com.google.android.exoplayer:exoplayer:r2.5.3'

implementation 'com.google.android.exoplayer:exoplayer:2.6.1'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:mediarouter-v7:26.1.0'
implementation 'com.google.android.gms:play-services-cast:10.0.1'

implementation(name: 'OoyalaCastSDK', ext: 'aar')
implementation files('libs/OoyalaSDK.jar')
implementation project(':CastCompanionLibrary')
implementation 'com.google.android.gms:play-services-cast-framework:12.0.0'
implementation files('libs/OoyalaSDK.aar')
implementation files('libs/OoyalaCastSDK.aar')

// For Development purpose only:
// implementation project(':core')
// implementation project(':cast')
}
}
17 changes: 0 additions & 17 deletions ChromecastSampleApp/app/proguard-rules.pro

This file was deleted.

77 changes: 17 additions & 60 deletions ChromecastSampleApp/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,76 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ooyala.sample">

<!--<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="19" />-->
<!--<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="23" />-->

package="com.ooyala.sample">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application
android:name=".utils.SampleApplication"
android:icon="@drawable/ic_launcher"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat" >
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<activity android:name=".lists.ChromecastListActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" android:textColor="#ffffff"
android:launchMode="singleTop">
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:name=".SampleApplication"
android:theme="@style/Theme.CastVideosTheme">
<activity android:name=".ChromecastListActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".players.ChromecastPlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" android:textColor="#ffffff"
android:parentActivityName=".lists.ChromecastListActivity"
android:launchMode="singleTop">
<activity android:name=".ChromecastPlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" android:textColor="#ffffff"
android:launchMode="singleTop"/>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".lists.ChromecastListActivity"/>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name=".players.ChromecastBarebonesPlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" android:textColor="#ffffff"
android:parentActivityName=".lists.ChromecastListActivity"
android:launchMode="singleTop">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".lists.ChromecastListActivity"/>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<receiver android:name="com.google.android.libraries.cast.companionlibrary.remotecontrol.VideoIntentReceiver" >
<intent-filter>
<action android:name="android.media.AUDIO_BECOMING_NOISY" />
<action android:name="android.intent.action.MEDIA_BUTTON" />
<action android:name="com.google.android.libraries.cast.companionlibrary.action.toggleplayback" />
<action android:name="com.google.android.libraries.cast.companionlibrary.action.stop" />
</intent-filter>
</receiver>

<service
android:name="com.google.android.libraries.cast.companionlibrary.notification.VideoCastNotificationService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.libraries.cast.companionlibrary.action.notificationvisibility" />
</intent-filter>
</service>

<service android:name="com.google.android.libraries.cast.companionlibrary.cast.reconnection.ReconnectionService"/>
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.ooyala.sample.CastOptionsProvider" />

</application>
</manifest>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

package com.ooyala.sample;

import android.content.Context;

import com.google.android.gms.cast.framework.CastOptions;
import com.google.android.gms.cast.framework.OptionsProvider;
import com.google.android.gms.cast.framework.SessionProvider;
import com.google.android.gms.cast.framework.media.CastMediaOptions;
import com.google.android.gms.cast.framework.media.NotificationOptions;

import java.util.List;


/**
* It is used to provide google cast options by manifest.
*/
public class CastOptionsProvider implements OptionsProvider {
private final String APP_ID = "4172C76F";

@Override
public CastOptions getCastOptions(Context context) {
NotificationOptions notificationOptions = new NotificationOptions.Builder()
.setPlayDrawableResId(R.drawable.ic_media_play_light)
.setPauseDrawableResId(R.drawable.ic_media_pause_light)
.build();
CastMediaOptions mediaOptions = new CastMediaOptions.Builder()
.setNotificationOptions(notificationOptions)
.setExpandedControllerActivityClassName(ChromecastPlayerActivity.class.getName())
.build();

return new CastOptions.Builder()
.setReceiverApplicationId(APP_ID)
.setCastMediaOptions(mediaOptions)
.build();
}

@Override
public List<SessionProvider> getAdditionalSessionProviders(Context context) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ooyala.sample.utils;
package com.ooyala.sample;

import android.app.Activity;
import android.content.Context;
Expand All @@ -7,40 +7,35 @@
import android.widget.TextView;

import com.ooyala.android.OoyalaPlayer;
import com.ooyala.android.OoyalaPlayer.State;
import com.ooyala.android.castsdk.CastManager;
import com.ooyala.cast.CastManager;
import com.ooyala.cast.UpdateImageViewRunnable;
import com.ooyala.android.item.Video;
import com.ooyala.sample.R;

/**
* This is an example of a way to manage the view that is displayed in the player while casting
*/
public class CastViewManager {
class CastViewManager {
private View castView;
private TextView stateTextView;

public CastViewManager(Activity activity, CastManager manager) {
CastViewManager(Activity activity, CastManager manager) {
castView = activity.getLayoutInflater().inflate(R.layout.cast_video_view, null);
manager.setCastView(castView);
stateTextView = (TextView)castView.findViewById(R.id.castStateTextView);
stateTextView = castView.findViewById(R.id.castStateTextView);
}

public void configureCastView(Video video) {
final ImageView castBackgroundImage = (ImageView) castView.findViewById(R.id.castBackgroundImage);
void configureCastView(Video video) {
final ImageView castBackgroundImage = castView.findViewById(R.id.castBackgroundImage);

// Update the ImageView on a separate thread

new Thread(new UpdateImageViewRunnable(castBackgroundImage, video.getPromoImageURL(0, 0))).start();

TextView videoTitle = (TextView) castView.findViewById(R.id.videoTitle);
TextView videoTitle = castView.findViewById(R.id.videoTitle);
videoTitle.setText(video.getTitle());

TextView videoDescription = (TextView) castView.findViewById(R.id.videoDescription);
TextView videoDescription = castView.findViewById(R.id.videoDescription);
videoDescription.setText(video.getDescription());
}

public void updateCastState(Context c, State state) {
String castDeviceName = CastManager.getVideoCastManager().getDeviceName();
void updateCastState(Context c, OoyalaPlayer.State state) {
String castDeviceName = CastManager.getCastManager().getDeviceName();
if (state == OoyalaPlayer.State.LOADING) {
stateTextView.setText(c.getString(R.string.loading));
} else if (state == OoyalaPlayer.State.PLAYING || state == OoyalaPlayer.State.PAUSED) {
Expand All @@ -51,3 +46,4 @@ public void updateCastState(Context c, State state) {
}
}
}

Loading

0 comments on commit e829d80

Please sign in to comment.