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

Videos won't play after publishing

4 Answers 173 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Curt
Top achievements
Rank 1
Curt asked on 20 May 2016, 07:33 PM

I have a gallery of three RadMediaPlayer controls.  The sources are added in the code behind.  The mp4 files are sitting in a folder at the root of the app.  The videos play in debug mode, but when I publish and upload to the dev web server, the video players don't play.  They are just black boxes.  I'm using IE11 and Chrome.  In debug mode, the videos all play in both browsers, but after publishing none of them play in either browser.  I have confirmed that the video files are included in the deployed published content and that the folder's path is consistent.  What would cause them to not play after publishing?

Code behind snippet:

protected void Page_Load(object sender, EventArgs e)
   {
       videoPlayer1.Source = ConfigurationManager.AppSettings["MediaUrl"] + "Video01_EMISPurposeOverview.mp4";
       videoPlayer2.Source = ConfigurationManager.AppSettings["MediaUrl"] + "Video02_AccessHomepageOverview.mp4";
       videoPlayer3.Source = ConfigurationManager.AppSettings["MediaUrl"] + "Video03_PrintingInspections.mp4";
       videoPlayer4.Source = ConfigurationManager.AppSettings["MediaUrl"] + "Video04_EnteringResultsResolutionOptions.mp4";
   }

HTML snippet:

    <tr class="galleryRow">
<td>
<div class="videoWrapper">
<telerik:RadMediaPlayer ID="videoPlayer1" runat="server" Source="" Width="300" />
<p class="videoCaption">EMIS Purpose Overview</p>
</div>
</td>
<td>
<div class="videoWrapper">
<telerik:RadMediaPlayer ID="videoPlayer2" runat="server" Source="" Width="300" />
<p class="videoCaption">Homepage Access & Overview</p>
</div>
</td>
<td>
<div class="videoWrapper">
<telerik:RadMediaPlayer ID="videoPlayer3" runat="server" Source="" Width="300" />
<p class="videoCaption">Printing Inspections</p>
</div>
</td>
</tr>

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 25 May 2016, 01:27 PM
Hi Curt,

Here are some common suggestions you can try to track down the reason for the issue:

1. Remove RadCompression from your web.config in case it is enabled:
http://www.telerik.com/help/aspnet-ajax/compression.html

‚Äč2. Also, the CDN if present:
http://docs.telerik.com/devtools/aspnet-ajax/controls/scriptmanager/cdn-support/overview
Copy Code
<add key="Telerik.ScriptManager.TelerikCdn" value="Disabled" />

3. Make sure that you are not using RadAjaxPanel or RadAjaxManager at the same time. They should not be implemented simultaneously:
http://www.telerik.com/help/aspnet-ajax/ajax-controls-in-ajaxpanel-and-ajaxsettings.html


4. If the issue remains, temporarily remove any ajaxification (RadAjaxManager) on the page and enable your script debugger (FireBug or F12) to see whether a more descriptive script or server error will arise. And if it does, you can debug the problematic lines of the application to track down the issue and root it out.


Also, make sure that video Folder is not located within the App_Data folder. This name is reserved by Visual Studio to contain database related files:
https://msdn.microsoft.com/en-us/library/ex526337.aspx


Do the videos play if you set them declaratively in the mark-up definition?
<telerik:RadMediaPlayer ID="videoPlayer1" runat="server" Source="~/VideoFolder/videoName.mp4" Width="300" />

Essentially, the player control extends the default HTML5 video and audio tag (except for older IE versions) and the available formats are entirely dependent on the browser capabilities. In this sense, the player should play any video or audio which is playable via the default <video> and <audio> tags:
http://www.w3schools.com/html/html5_video.asp

http://www.w3schools.com/html/html5_audio.asp

Please try the source path with a regular video tag and let me know if the browser plays it as expected.


Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Curt
Top achievements
Rank 1
answered on 25 May 2016, 01:49 PM

Thanks for the suggestions.

The problem was in IIS.  Under MIME Types, .mp4 was not included.  We added .mp4 to the MIME Types, restarted IIS and that fixed the problem.

0
hart
Top achievements
Rank 1
Veteran
answered on 29 Dec 2016, 10:13 PM
Curt -- I am giving you 2 thumbs up on this.  Search for a long time, made the change to IIS like you said - and presto!!! All worked great!
0
Stuart at Enjo Oz
Top achievements
Rank 1
answered on 11 Feb 2020, 11:52 PM

Likewise from me Curt - spent hours trawling through forum posts wondering why I couldn't view videos on the live site but had no issues in dev environment.

Great find, thanks for sharing :)

Tags
MediaPlayer
Asked by
Curt
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Curt
Top achievements
Rank 1
hart
Top achievements
Rank 1
Veteran
Stuart at Enjo Oz
Top achievements
Rank 1
Share this question
or