Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 YouTube Video Error
 New Topic
 Printer Friendly
Next Page
Author  Topic Next Topic
Page: of 2

MaGraham
Senior Member

USA
1297 Posts

Posted - 19 June 2016 :  09:08:54  Show Profile  Reply with Quote

The YouTube videos are not displaying on my site. I'm not receiving an error. In a post only the link displays, and it displays like this below.



https://www.youtube.com/watch?v=eNxO9MpQ2vA?autoplay=0" />



Does anyone have any clue as to how to correct this?

Here are the YouTube codes from my inc_func_common.asp if someone, please, has time to look at this.




Function ReplaceYouTubeTags(fString)
   fString=Replace(fString, "youtu.be/", "www.youtube.com/v/")
   fString=Replace(fString, "watch?v=", "v/")
   If InStr(fString, "[youtube]") > 0 Then fString=Replace(fString, "https", "http")
   For intFI = 1 to Len(fString)
      If Mid(fString,intFI,9)="[youtube]" Then
         intFJ=intFI+9
      End If
      If Mid(fString,intFI,10)="[/youtube]" Then
         intFK=intFI
         strMovLK = Mid(fString,intFJ,intFK-intFJ)
         Exit For
      End If
   Next
   Dim oTag, cTag
   Dim roTag1, rcTag1, roTag2, rcTag2
   Dim oTagPos, cTagPos
   Dim nTagPos
   Dim counter1, counter2, counter3
   Dim strCodeText
   Dim Tagcount
   Dim strTempString, strResultString
   TagCount = 1
   Dim CodeTags(1,2,3)
   Dim strArray, strArray2, strArray3, strArray4
   CodeTags(1,1,1) = "[youtube]"
   CodeTags(1,2,1) = "[/youtube]"
   If Instr(strMovLK,"http") = 0 Then
      CodeTags(1,1,2) = "<object width=""640"" height=""390""><param name=""movie"" value=""http://www.youtube.com/v/"
   Else
      CodeTags(1,1,2) = "<object width=""640"" height=""390""><param name=""movie"" value="""
   End If
   CodeTags(1,2,2) = "?autoplay=0"" /><param allowfullscreen=""true"" /><param wmode=""transparent"" />"
   If Instr(strMovLK,"http") = 0 Then
      CodeTags(1,1,3) = "<embed src=""http://www.youtube.com/v/"
   Else
      CodeTags(1,1,3) = "<embed src="""
   End If
   CodeTags(1,2,3) = "?autoplay=0"" type=""application/x-shockwave-flash"" allowfullscreen=""true"" wmode=""transparent"" width=""640"" height=""390"" /></object>"
   strResultString = ""
   strTempString = fString
   For counter1 = 1 To TagCount
      oTag     = CodeTags(counter1,1,1)
      roTag1  = CodeTags(counter1,1,2)
      roTag2  = CodeTags(counter1,1,3)
      cTag     = CodeTags(counter1,2,1)
      rcTag1  = CodeTags(counter1,2,2)
      rcTag2  = CodeTags(counter1,2,3)
      oTagPos= InStr(1, strTempString, oTag, 1)
      cTagPos= InStr(1, strTempString, cTag, 1)
      If (oTagpos > 0) And (cTagPos > 0) Then
         strArray = Split(strTempString, oTag, -1, 1)
         For counter2 = 0 To UBound(strArray)
            If (InStr(1, strArray(counter2), cTag) > 0) Then
               strArray2 = Split(strArray(counter2), cTag, -1, 1)
               strCodeText = Trim(strArray2(0))
               If (LCase(Left(strCodeText,2))="<a") Then
                  strArray3 = Split(strCodeText, ">", -1, 1)
                  If (UBound(strArray3)>0) Then
                     strCodeText = Left(strArray3(1), Len(strArray3(1))-3)
                     strArray3 = Split(strCodeText, "?", -1, 1)
                     If (UBound(strArray3)>0) Then
                        strCodeText = strArray3(1)
                        strArray3 = Split(strCodeText, "&", -1, 1)
                        For counter3 = 0 To UBound(strArray3)
                           strArray4 = Split(strArray3(counter3), "=", -1, 1)
                           If (UBound(strArray4)=1) And (LCase(strArray4(0))="v") Then
                              strCodeText = strArray4(1)
                              Exit For
                           End If
                        Next
                     End If
                  End If
               End If
               strResultString = strResultString & roTag1 & strCodeText & rcTag1 & roTag2 & strCodeText & rcTag2 & strArray2(1)
            Else
               strResultString = strResultString & strArray(counter2)
            End If
         Next
         strTempString = strResultString
         strResultString = ""
      End If
   Next
   ReplaceYouTubeTags = strTempString
End Function



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 20 June 2016 00:32:08

HuwR
Forum Admin

United Kingdom
20578 Posts

Posted - 20 June 2016 :  04:19:12  Show Profile  Visit HuwR's Homepage
it is possibly related to the two ? in your url, there should normally be only one, the second ? should be an & I would think
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 20 June 2016 :  06:57:49  Show Profile

No, that produced the same results, Huw.


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 20 June 2016 :  07:42:35  Show Profile

I removed what you see in red below (the first "?autoplay").

CodeTags(1,2,2) = "?autoplay=0"" /><param allowfullscreen=""true"" /><param wmode=""transparent"" />"

The videos now display. They also play just fine. However, the YouTube video link displays just above the video in the post, when obviously there shouldn't be a link displaying in the post. I tried adding an & instead of the ? in the second "&autoplay" but that didn't change the results.


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 20 June 2016 07:52:43
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20578 Posts

Posted - 22 June 2016 :  07:30:44  Show Profile  Visit HuwR's Homepage
could you post the RAW (unconverted forumcode) of a post inquestion, together with a screenshot of what it is displaying, seems that it is not parsing the tags correctly
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 22 June 2016 :  18:29:17  Show Profile

Here's the forum code from one of the posts, Huw.

[youtube]https://youtu.be/nXgc0QJ_tiU[/youtube]

It's no longer displaying the part below in red after the post is submitted:
https://youtu.be/nXgc0QJ_tiU?autoplay=0" />


In the post the YouTube link is displayed exactly like this below:
https://youtu.be/nXgc0QJ_tiU
And then the video is displayed directly below the link in the post.


Here's my codes again from my inc_func_common.asp so you can see the changes I've made.



Function ReplaceYouTubeTags(fString)
   fString=Replace(fString, "youtu.be/", "www.youtube.com/v/")
   fString=Replace(fString, "watch?v=", "v/")
'  If InStr(fString, "[youtube]") > 0 Then fString=Replace(fString, "http", "http")
   For intFI = 1 to Len(fString)
      If Mid(fString,intFI,9)="[youtube]" Then
         intFJ=intFI+9
      End If
      If Mid(fString,intFI,10)="[/youtube]" Then
         intFK=intFI
         strMovLK = Mid(fString,intFJ,intFK-intFJ)
         Exit For
      End If
   Next
   Dim oTag, cTag
   Dim roTag1, rcTag1, roTag2, rcTag2
   Dim oTagPos, cTagPos
   Dim nTagPos
   Dim counter1, counter2, counter3
   Dim strCodeText
   Dim Tagcount
   Dim strTempString, strResultString
   TagCount = 1
   Dim CodeTags(1,2,3)
   Dim strArray, strArray2, strArray3, strArray4
   CodeTags(1,1,1) = "[youtube]"
   CodeTags(1,2,1) = "[/youtube]"
   If Instr(strMovLK,"http") = 0 Then
      CodeTags(1,1,2) = "<object width=""640"" height=""390""><param name=""movie"" value=""https://www.youtube.com/v/"
   Else
      CodeTags(1,1,2) = "<object width=""640"" height=""390""><param name=""movie"" value="""
   End If
   CodeTags(1,2,2) = "<param allowfullscreen=""true"" /><param wmode=""transparent"" />"
   If Instr(strMovLK,"http") = 0 Then
      CodeTags(1,1,3) = "<embed src=""https://www.youtube.com/v/"
   Else
      CodeTags(1,1,3) = "<embed src="""
   End If
   CodeTags(1,2,3) = "?autoplay=0"" type=""application/x-shockwave-flash"" allowfullscreen=""true"" wmode=""transparent"" width=""640"" height=""390"" /></object>"
   strResultString = ""
   strTempString = fString
   For counter1 = 1 To TagCount
      oTag     = CodeTags(counter1,1,1)
      roTag1  = CodeTags(counter1,1,2)
      roTag2  = CodeTags(counter1,1,3)
      cTag     = CodeTags(counter1,2,1)
      rcTag1  = CodeTags(counter1,2,2)
      rcTag2  = CodeTags(counter1,2,3)
      oTagPos= InStr(1, strTempString, oTag, 1)
      cTagPos= InStr(1, strTempString, cTag, 1)
      If (oTagpos > 0) And (cTagPos > 0) Then
         strArray = Split(strTempString, oTag, -1, 1)
         For counter2 = 0 To UBound(strArray)
            If (InStr(1, strArray(counter2), cTag) > 0) Then
               strArray2 = Split(strArray(counter2), cTag, -1, 1)
               strCodeText = Trim(strArray2(0))
               If (LCase(Left(strCodeText,2))="<a") Then
                  strArray3 = Split(strCodeText, ">", -1, 1)
                  If (UBound(strArray3)>0) Then
                     strCodeText = Left(strArray3(1), Len(strArray3(1))-3)
                     strArray3 = Split(strCodeText, "?", -1, 1)
                     If (UBound(strArray3)>0) Then
                        strCodeText = strArray3(1)
                        strArray3 = Split(strCodeText, "&", -1, 1)
                        For counter3 = 0 To UBound(strArray3)
                           strArray4 = Split(strArray3(counter3), "=", -1, 1)
                           If (UBound(strArray4)=1) And (LCase(strArray4(0))="v") Then
                              strCodeText = strArray4(1)
                              Exit For
                           End If
                        Next
                     End If
                  End If
               End If
               strResultString = strResultString & roTag1 & strCodeText & rcTag1 & roTag2 & strCodeText & rcTag2 & strArray2(1)
            Else
               strResultString = strResultString & strArray(counter2)
            End If
         Next
         strTempString = strResultString
         strResultString = ""
      End If
   Next
   ReplaceYouTubeTags = strTempString
End Function




We can live with the link displaying within the post now that the video finally displays (and plays fine). Needless to say, it's really odd that the link displays along with the video.


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Edited by - MaGraham on 23 June 2016 06:56:39
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20578 Posts

Posted - 23 June 2016 :  07:28:46  Show Profile  Visit HuwR's Homepage
I'll take a peak at the code later and see if I can see why it is showing the link as well
Go to Top of Page

volkerc
Junior Member

Germany
156 Posts

Posted - 16 August 2016 :  04:23:09  Show Profile
Seems that you tube is no longer supporting flash, instead they support html5. How can we still have the videos displayed in the forum?

Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 16 August 2016 :  17:56:04  Show Profile  Visit bobby131313's Homepage
Is this what some users are seeing?



So far my preliminary findings are that all users that see this are using Chrome/52.

Switch the order of your title tags
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 16 August 2016 :  18:43:41  Show Profile  Visit golfmann's Homepage
That's what I get too..
on Maxthon (uses Chrome engine) and Chrome...
Firefox works ok.

Edited by - golfmann on 16 August 2016 18:47:10
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 16 August 2016 :  18:47:55  Show Profile  Visit bobby131313's Homepage
Probably has to do with html5. I'm going to look into it more tonight or tomorrow.

Switch the order of your title tags
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20578 Posts

Posted - 16 August 2016 :  20:30:38  Show Profile  Visit HuwR's Homepage
well, if it affects chrome only then it is unlikely to be youtube that is the problem

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 16 August 2016 :  20:56:11  Show Profile  Visit bobby131313's Homepage
I think Chrome has abandoned flash starting with version 52. What I've seen so far is if you use the iframe code it will default to html5, embed code will not and fails.

Switch the order of your title tags
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 16 August 2016 :  21:34:18  Show Profile  Visit golfmann's Homepage
YouTube has dropped flash, I think. All html5 now.
Since Chrome owns youtube, it's all kind of crazy to me but I'm old and don't know better :)

I guess ideally, things need to be re-written in HTML5 with the <video> </video>... ???
I'll get right on it. (not)

Edited by - golfmann on 17 August 2016 00:49:44
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 17 August 2016 :  09:42:36  Show Profile  Visit bobby131313's Homepage
The iframe code will default to html5. I replaced my code in inc_func_common.asp with this...


 	CodeTags(1,1,1) = "[youtube]"
 	CodeTags(1,2,1) = "[/youtube]"
 	CodeTags(1,1,2) = "<div class=""youtube""><iframe width=""100%"" height=""100%"" src=""https://www.youtube.com/embed/"
 	CodeTags(1,2,2) = """ frameborder=""0"" allowfullscreen>"
	CodeTags(1,1,3) = "</iframe>"
	CodeTags(1,2,3) = "</div>"


And put this in my CSS file...


.youtube {
margin:10px;
max-width:600px;
width:95%;
height:400px;
max-height:100%;
font-size:0px
}


Everyone is reporting it working fine and it will shrink fairly gracefully on small screens.

There is a bug which the CSS hides though. The video ID shows under the video and I couldn't fix it so the CSS hides it.

Switch the order of your title tags

Edited by - bobby131313 on 17 August 2016 09:43:23
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 17 August 2016 :  16:32:22  Show Profile  Visit golfmann's Homepage
I don't understand though why they work fine in Firefox...

(still fiddling with mine. I have Marcell's old code and trying to clean it up for just youtube) NOT fun :)
Go to Top of Page
Page: of 2  Topic Next Topic  
Next Page
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07