-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide IONIC example #4
Comments
@khalisafkari I don't use Ionic so I can't be of help. If you manage to make it work please share what you needed to do. |
If anyone has a working IONIC example please share! |
I had successfully implemented in ionic before.I am using the plugin version 1.0.0
$scope.playAudio=function(url){
var params = {
url: url,
user_agent: "PluginExoPlayer",
plugin_controls_visible: true,
aspect_ratio: 'fit_screen',
full_screen: true,
raw_touch_events: false,
header: { // top header panel
height: 400,
padding: 30,
background_color: "#22222222",
image_url: imageUrl,
text_color: "#FFFFFFFF",
text_align: "center" ,// left, center or right
text: head,
text_size: 20
}
}
var player = exoplayer.init(params);
//player.play()
player.show(function(success) {
console.log("success", success)
}, function(err) { console.log("err", err) })
}
$scope.playVideo= function(url){
var params = {
//type: 'hls',
url: url,
user_agent: "PluginExoPlayer",
plugin_controls_visible: true,
aspect_ratio: 'fit_screen',
full_screen: true,
raw_touch_events: false
}
var player = exoplayer.init(params);
//player.play()
player.show(function(success) {
console.log("success", success)
if(success.event_type == "stop_event"){
screen.orientation.unlock()
}
}, function(err) { console.log("err", err) })
}
|
@go2hyder Do you mind upgrading to the latest version of the plugin and sending new setup code? I'd like to publish it on the main page and give you credit for it. |
@frontyard Sorry for the late reply I have updated the plugin and create a sample repository Please check this https://github.com/go2hyder/Ionic-example-for-cordova-Exoplayer |
can someone provide an Ionic v2 or v3 sample? |
Here's an example with Ionic 2, for those looking: https://github.com/spyderboy/ionic2Exoplayer |
Please tutorial auto fullscreen landscape |
@khalisafkari Have any of the examples provided here helped you? |
I've just submitted a PR to add the plugin to Ionic Native: danielsogl/awesome-cordova-plugins#2180, feel free to comment if you think there is a mistake |
IONIC 3 - working example @khalisafkari import {Component} from '@angular/core';
import {NavController} from 'ionic-angular';
import {AndroidExoplayer} from '@ionic-native/android-exoplayer';
@Component({
selector: 'page-home',
templateUrl: 'home.html',
providers:[AndroidExoplayer]
})
export class HomePage {
url="http://184.72.239.149/vod/smil:BigBuckBunny.smil/playlist.m3u8"
constructor(public navCtrl: NavController, private exo: AndroidExoplayer) {
this.play()
}
play() {
this.exo.show({url:this.url}).subscribe(res => {
if (res.eventType == 'KEY_EVENT') {
this.exo.close();
}
});
}
} |
How to set options for ionic 3 & show control icons? @fthkrtl35 |
Is there a way to play audio only? The param {'audioOnly': false} throws an error => not assignable to parameter of type 'AndroidExoPlayerParams'. |
Ionic 3 and Ionic 2. This is for Folks looking for Audio in background mode. import { Platform } from 'ionic-angular';
declare var ExoPlayer;
import { Injectable } from '@angular/core';
@Injectable()
export class RadioPlayer {
constructor(public plt: Platform) {
}
play(streamurl) {
var params = {
url: streamurl,
audioOnly: true
}
this.plt.ready().then(() => {
ExoPlayer.show(params);
});
};
pause() {
ExoPlayer.close();
};
} |
Hello, thanks to give us this plugin. this is my code
Thanks!! |
@maikolestevez Anything in "adb logcat"? |
Thanks, I haven`t check adb logcat. this is the error Im getting from adb logcat D/AndroidRuntime(11422): Shutting down VM |
Done!!!, After checking the logcat I infer that i was missing something that the plugin needs to work so I add all of the others property and end up with this: adding textButton,butttonColor and bufferingColor it works
Others things that i saw is that the TS wrapper doesn't have all of the property needed and at the end is better working without it until we improve this, for example textColor is needed for me to make it work but the intellisense told me textColor' does not exist in type 'AndroidExoPlayerControllerConfig' and I couldn't add it with the wrapper, so i have to use this approach to make it work Thank you very much |
Hi I can not get the plugin to work, I get the error ExoPlayer is not defined - Use ionic 3.9.2 It's my code home.html <button ion-button block (click)="openLiveRadio()">Play home.ts @component({ constructor(public navCtrl: NavController, public plt: Platform) { openLiveRadio() { } Please Help |
@bme1983 bro i just did:
then this code
This is working prefect. checkout in your node_modules if you have installed the plugin, your code should be working node_modules |
Hi @maikolestevez Its my app.modules.ts import { AndroidExoplayer } from '@ionic-native/android-exoplayer'; providers: [ Tanks for help |
hi! i'm trying to close exoplayer when i press the backbutton, however i can't, the player keeps playing the data stream. Here´s my code, i'm using ionic 5.
} |
ExoPlayer.close() definitely works. Back button is kind of special on some platforms, maybe you're not getting that event from the plugin. Try adding plain Cordova keyboard listener and see if you're getting it there. If you are then just close the player there. |
Can you provide any example of doing that? I've tried doing a Cordova only version of the app but I still have that problem. That's why I tried doing it on ionic |
Adding listeners in plain Cordova app would be done like this: document.addEventListener('backbutton', backButtonEventHandler, false); There are more events that Cordova sends, these 2 are just as an example. In your backButtonEventHandler you would do: |
Thanks for your example, but i fixed it by changing the library to streamingMedia. |
No problem. Which streamingMedia library are you referring to @latinochannels? |
How can I play video in Ionic 5 angular12 , I am using Capacitor android and @ionic-native/android-exoplayer and after build apk its not showing player view that I have this.androidExoPlayer.show({ }); Please help |
Customizing ExoPlayer attributes in Ionic 5 angular12 please help me |
How to play video in Vue using this ionic Framework |
Example project for ionic
The text was updated successfully, but these errors were encountered: