This is a migrated thread and some comments may be shown as answers.

MediaPlayer

5 Answers 156 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Les
Top achievements
Rank 1
Les asked on 12 Nov 2016, 04:49 PM

A couple of items:
1. Can a separate Thread/Topic for "MediaPlayer" be set up  in "aspnet-core-ui"?
2. I find that the Source does not appear to work...(ie. localhost under  wwwroot)

   I have tried the following variations in the code below (the source to youtube works) ... any recommendations?

                .Source( "assets/Videos/MyVideo.mp4")  

                .Source( "~/assets/Videos/MyVideo.mp4")  

                .Source( "~assets/Videos/MyVideo.mp4")  

    @(Html.Kendo().MediaPlayer()
            .Name("mediaPlayer")
            .AutoPlay(true)
            .Navigatable(true)
            .Media(m => m
                .Title("Recap of Progress Ringing The Bell at Nasdaq (2016)")
                .Source( "~/assets/Videos/MyVideo.mp4")            
            )
            .HtmlAttributes(new { style = "height:360px" })
            .Deferred()
    )

5 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 17 Nov 2016, 05:22 AM
Hi Les,

Does it work when playing a YouTube source?
http://demos.telerik.com/aspnet-core/mediaplayer/index

Or when the video is located in another folder:
http://docs.telerik.com/aspnet-mvc/helpers/mediaplayer/overview#initialize-the-mediaplayer

You can play the original source with a regular HTML5 video tag and see whether it runs as expected to ensure that the path is correct:
http://www.w3schools.com/html/html5_video.asp

Regards,
Eyup
Telerik by Progress
Telerik UI for ASP.NET Core is ready for Visual Studio 2017 RC! Learn more.
0
Les
Top achievements
Rank 1
answered on 17 Nov 2016, 12:57 PM

It does work with YouTube & HTML 5.

The scenario does not work with the following Telerik example:

Or when the video is located in another folder:
http://docs.telerik.com/aspnet-mvc/helpers/mediaplayer/overview#initialize-the-mediaplayer

I even tried the following:

Scenario 1

                .Source(new[] {
                     new { quality = "480p", url = "assets/Videos/MyVideo.mp4" }
                })

Scenario 2

                .Source(new[] {
                     new { quality = "480p", url = "~/assets/Videos/MyVideo.mp4" }
                })

 

 

0
Les
Top achievements
Rank 1
answered on 17 Nov 2016, 07:26 PM

I just tried the following and it works...

                .Source(new[] {
                     new {  url = Url.Content("~/Assets/Videos/MyAppModel2.mp4") }
                })

I am under the impression that I shouldn't have to use Url.Content.

I am now on my way.

Thanks

0
Les
Top achievements
Rank 1
answered on 17 Nov 2016, 08:13 PM

Hi, I am now having an issue with your Playlist demo....the demo works fine with Youtube....but does not with local files....

http://demos.telerik.com/aspnet-core/mediaplayer/playlist

Could this be related to the url & Url.Content as mentioned above?

Regards,

Les

0
Eyup
Telerik team
answered on 22 Nov 2016, 10:55 AM
Hello Les,

Yes, you are correct. You can try to use one of the following approaches to achieve this requirement, which will pass the correct path to the media player component:
Url.Content("~/Video/video1.mp4")
"../Video/video1.mp4"

Regards,
Eyup
Telerik by Progress
Telerik UI for ASP.NET Core is ready for Visual Studio 2017 RC! Learn more.
Tags
General Discussions
Asked by
Les
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Les
Top achievements
Rank 1
Share this question
or