Video player ionic (Resolved)


#1

Someone is playing videos on ionic 2 ? Which plugin should I use?


#2

:video_camera:

You could use the video element if you have the video local?

If not, most external video services have embed codes you could use. This should work without any issues.


#3

Thanks, iframe works!


#4

How to use vedio player plugin and call from html page ?
I am using ionic2 RC2.0 after inspecting i am getting error saying vedio-player plugin is not installed but plugins it is there .

For some reason its not calling that plugin not playing video … Testing on Android device

Let me know where i should put my audio file and URL since i am not finding android_assets directory in platform of android …

Thanks in advance …


#5

Hi mhartington , its good to see the posts u do … I need some help the questions are mentioned below…
How to use vedio player plugin and call from html page ?
I am using ionic2 RC2.0 after inspecting i am getting error saying vedio-player plugin is not installed but plugins it is there .

For some reason its not calling that plugin not playing video … Testing on Android device

Let me know where i should put my audio file and URL since i am not finding android_assets directory in platform of android …

Thanks in advance …


#6

Hi gabrielmalinosqui ,

I was trying with playing videos and audio file for videos i tried to include the VideoPlayer ionic native plugin but its coming to exception … May i know how you make that work with iframe .

In fact i am new to this field i need to know as soon as possible

My environment
Os : windows 10
ionic v2 RC2


#8

Hi, does this work in all platforms? I am concern about IOs. Can you please confirm it.


#9

Videos kept in html5 video tag are breaking in mobile, they are not responisive. Please suggest me some ways to make it reponisve

<video fullscreen=“fullscreen” autoplay=“true” (ended)=“videoEnded()” controls>


#10
<ion-content>
  <video fullscreen="fullscreen" autoplay="true" (ended)="videoEnded()" controls>
  <source src="assets/videos/voya_vid.mov" type="video/mp4">
</video>

#11

In case if you still have this problem you can use http://ionicframework.com/docs/native/video-player/ or http://ionicframework.com/docs/native/streaming-media/.


#12

Video player:- it’s not working totally.
Streaming-media: it’s working,but not working for all videos.
Can you please suggest anything.


#13

@abinas444 what you want to achieve and where you are facing the problem?


#14

1st:- for Video player i am not able to install the plugin by using
ionic cordova plugin add https://github.com/moust/cordova-plugin-videoplayer.git as per the ionic documentation.
Then i tried this issue, but could not able install it also.
Got this error

 Error: Failed to fetch plugin https://github.com/moust/cordova-plugin-videoplayer via registry.
    Probably this is either a connection problem, or plugin spec is 
    incorrect.
    Check your connection and plugin name/version/URL

Then I came to know about Streaming idea, it’s beautiful plugin because it support both for Android and ios, which is not in case of videoPlayer plugin. Then i tried to execute the below code.

let options: StreamingVideoOptions = {
            successCallback: () => {
                console.log('Video played');
            },
            errorCallback: (e) => {
                console.log(e);
            },
            orientation: 'landscape'
        };
        this.streamingMedia.playVideo('http://clips.vorwaerts-gmbh.de/VfE_html5.mp4',options);

This code is working perfect but not for every video.
2nd:- What i want to achieve?
I want the video will play and pause while i scroll down the screen.

Thank you.


#15

If your Trying to play videos from an URL, then you can use the below code as well.

<video style="width: 100%;height: 200px;" src = "{{video_link}}#t=0.1" controls >
</video>

#16

Is there any other way instead of using html video tag to get native experience.


#17

These two were 2 ways of achieving it

http://ionicframework.com/docs/native/video-player/84 or
http://ionicframework.com/docs/native/streaming-media/

But you have already tried them. My suggestion is choose streaming media plugin and convert the videos to a
common format that can be played by streaming media.


#18

src = “{{video_link}}#t=0.1”
#t=0.1 part was my problem thanxs alot ,but can i know what #t=0.1 actually do :smiley:


#19

#t=0.1 will start the video from 0.1 sec during the load itself. Which appear like a thumbnail image for the video.


#20

@vasanthb thanks for explanation you saved really alot of time of me :smiley: